From a8bc17661e9d7067b8800fcde1dcb73a594a8c5d Mon Sep 17 00:00:00 2001 From: Adrian Campos Date: Tue, 26 Oct 2021 12:21:22 -0700 Subject: [PATCH 1/6] Add section 1 --- section1/ex1.rb | 8 ++++++ section1/ex2.rb | 9 +++++++ section1/ex3.rb | 37 ++++++++++++++++++++++++++ section1/ex4.rb | 32 ++++++++++++++++++++++ section1/ex5.rb | 22 ++++++++++++++++ section1/ex6.rb | 41 +++++++++++++++++++++++++++++ section1/ex7.rb | 18 +++++++++++++ section1/exercises/booleans.rb | 5 ++-- section1/exercises/interpolation.rb | 8 ++++-- section1/exercises/loops.rb | 10 ++++--- section1/exercises/numbers.rb | 6 ++--- section1/exercises/strings.rb | 7 ++--- section1/exercises/variables.rb | 35 +++++++++++++++++------- section1/reflection.md | 15 +++++++++-- 14 files changed, 228 insertions(+), 25 deletions(-) create mode 100644 section1/ex1.rb create mode 100644 section1/ex2.rb create mode 100644 section1/ex3.rb create mode 100644 section1/ex4.rb create mode 100644 section1/ex5.rb create mode 100644 section1/ex6.rb create mode 100644 section1/ex7.rb diff --git a/section1/ex1.rb b/section1/ex1.rb new file mode 100644 index 000000000..2d38a7306 --- /dev/null +++ b/section1/ex1.rb @@ -0,0 +1,8 @@ +puts "Hello World!" +puts "Hello Again" +puts "I like typing this." +puts "This is fun." +puts "Yay! Printing" +puts "I'd much rather you 'not'." +puts 'I "said" do not touch this.' +# puts "hello universe!" diff --git a/section1/ex2.rb b/section1/ex2.rb new file mode 100644 index 000000000..d19e32c42 --- /dev/null +++ b/section1/ex2.rb @@ -0,0 +1,9 @@ +# A comment, this is so you can read your program later. +# Anything after the # is ignored by ruby. + +puts "I could have code like this." # and the comment after is ignored + +# You can also use a comment to "disable" or comment out a piece of code: +# puts "This wont run." + +puts "This will run." diff --git a/section1/ex3.rb b/section1/ex3.rb new file mode 100644 index 000000000..7f6e80dbf --- /dev/null +++ b/section1/ex3.rb @@ -0,0 +1,37 @@ +# This will print I will not count my chickens +puts "I will not count my chickens:" + +# This will print the amount of hens, which is 30/6 = 5, 5=25=30 +puts "Hens #{25.0 + 30.0 / 6.0}" +# This will print the amount of roosters, which is 25*3=75, 75/4=16 with remainder of 3, 100-3=97 +puts "Roosters #{100.0 - 25.0 * 3.0 % 4.0}" + +# This prints Now I will coung the eggs +puts "Now I will count the eggs:" + +# This prints 7 +puts 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0 + +# This prints Is it true that 3 + 2 , 5 - 7 +puts "Is it true that 3 + 2 < 5 - 7?" + +# This prints false because the equation is false, 5>-2 +puts 3.0 + 2.0 < 5.0 - 7.0 + +# This prints what is 3+2? with the outcome of 5 because of the #{3+2} +puts "What is 3 + 2? #{3.0 + 2.0}" +# This prints What is 5 - 7? with the outcome of -2 because of the #{5-7} +puts "What is 5 - 7? #{5.0 - 7.0}" + +# This prints Oh, thats why it's false. +puts "Oh, thats why it's false." + +# This prints How about some more. +puts "How about some more." + +# This prints Is it greater? with true because 5 is greater than -2 +puts "Is it greater? #{5.0 > -2.0}" +# This prints Is it greater or equal with true because 5 is greater or equal to -2 +puts "Is it greater or equal? #{5.0 >= -2.0}" +# This prints It is less or equal with false because 5 is not less than or equal to -2 +puts "Is it less or equal? #{5.0 <= -2.0}" diff --git a/section1/ex4.rb b/section1/ex4.rb new file mode 100644 index 000000000..3ea042159 --- /dev/null +++ b/section1/ex4.rb @@ -0,0 +1,32 @@ +# Establishes the variable cars is equal to 100 +cars = 100 +# Establishes the variable space_in_a_car is equal to 4 +space_in_a_car = 4 +# Establishes the variable drivers is equal to 30 +drivers = 30 +# Establishes the variable passengers is equal to 90 +passengers = 90 +# Establishes the variable cars_not_driven is equal to the varaible cars - variable drivers (100-30=70) +cars_not_driven = cars - drivers +# Establishes the variable cars_driven is equal to the variable drivers +cars_driven = drivers +# Establishes the variable carpool_capacity is equal to the variable cars_driven mutlipied by the variable space_in_a_car (30*4=120) +carpool_capacity = cars_driven * space_in_a_car +#Establishes the variable average_passengers_per_car is equal to the variable passengers divided by the variable cars_driven (90/30=3) +average_passengers_per_car = passengers / cars_driven + +# Prints There are 100 cars availble. +puts "There are #{cars} cars available." +# Prints There are only 30 drivers availble. +puts "There are only #{drivers} drivers available." +# Prints There will be 70 empty cars today. +puts "There will be #{cars_not_driven} empty cars today." +# Prints We can transport 120 people today. +puts "We can transport #{carpool_capacity} people today." +# Prints We have 90 to carpool today. +puts "We have #{passengers} to carpool today." +# Prints We need to put about 3 in each car. +puts "We need to put about #{average_passengers_per_car} in each car." + +# This error is because you didn't define what carpool_capacity is. You need to define carpool_capacity in order for it to be able to calculate the amount of people needed to be transported. This error most likely occured in line 7 when first writing the code. +# Taking away the .0 from 4.0 only makes the 120.0 people today turn into 120 people per day. Changes from floating point to regular number. diff --git a/section1/ex5.rb b/section1/ex5.rb new file mode 100644 index 000000000..d4a196022 --- /dev/null +++ b/section1/ex5.rb @@ -0,0 +1,22 @@ +name = 'Zed A. Shaw' +age = 35 # not a lie in 2009 +height = 74.0 # inches, now centimeters +weight = 180.0 # pounds, now kilograms +eyes = 'Blue' +teeth = 'White' +hair = 'Brown' +height_in_cm = height * 2.54 +weight_in_kg = weight * 0.45 + +puts "Let's talk about #{name}." +puts "He's #{height} inches tall." +puts "He's #{weight} pounds heavy." +puts "Actually that's not too heavy." +puts "He's got #{eyes} eyes and #{hair} hair." +puts "His teeth are usually #{teeth} depending on the coffee." +puts "In centimeters, he is #{height_in_cm} centimeters tall." +puts "In kilograms, he weighs #{weight_in_kg} kilograms." + + +# this line is tricky, try to get it exactly right +puts "If i add #{age}, #{height}, and #{weight} I get #{age + height + weight}" diff --git a/section1/ex6.rb b/section1/ex6.rb new file mode 100644 index 000000000..fa4749c97 --- /dev/null +++ b/section1/ex6.rb @@ -0,0 +1,41 @@ +# Assigning variable types_of_people with integer 10 +types_of_people = 10 +# Assigning variable x to There are 10 types of people. +x = "There are #{types_of_people} types of people." +# Assigning variable binary with value binary +binary = "binary" +# Assigningvariable do_not with value dont +do_not = "don't" +# Assiging variable y with value Those who know binary and those who don't. +y = "Those who know #{binary} and those who #{do_not}." + +# Priting variable x +puts x +# Printing variable y +puts y + +# Printing I said variable x (There are 10 types of people.) +puts "I said: #{x}." + +# Printing I also said: variable y (Those who know binary and those who don't.) +puts "I also said: '#{y}'." + +# Assigning variable hilarous with the value false +hilarious = false +# Assigning variable joke_evaluation with "Isn't that joke so funny?! False" +joke_evaluation = "Isn't that joke so funny?! #{hilarious}" + +# Printing variable joke_evaluation +puts joke_evaluation + +# Assigning variable w with value This is the left side of... +w = "This is the left side of..." +# Assigning variable e with value a string with a right side. +e = "a string with a right side." + +# Printing variable w and e together +puts w+e + +# There are 5 places where a string is put inside of a string. +# Adding w+e makes the string longer because its combinbing both of them into one sentence +# when you change the strings to use '' instead of "" makes interpolating not work. Double quotes will interpolate the variable, single quote can't. diff --git a/section1/ex7.rb b/section1/ex7.rb new file mode 100644 index 000000000..31546629b --- /dev/null +++ b/section1/ex7.rb @@ -0,0 +1,18 @@ +print "How old are you? " +age = gets.chomp +print "How tall are you? " +height = gets.chomp +print "How much do you weigh? " +weight = gets.chomp + +puts "So, you're #{age} old, #{height} tall and #{weight} heavy." + +print "When did you get a dog? " +dog = gets.chomp +print "When did you get a cat? " +cat = gets.chomp + +puts "Did you get a dog #{dog} and a cat #{cat}? " + +# gets.chomp gets asks the user something, and the chomp removes the new line so its stored on the same line +# There are many others way to use this, such as asking or answering certain questions diff --git a/section1/exercises/booleans.rb b/section1/exercises/booleans.rb index d3216d9d5..c761bb4fc 100644 --- a/section1/exercises/booleans.rb +++ b/section1/exercises/booleans.rb @@ -9,7 +9,8 @@ p 7 > 2 # YOU DO: log to the console the result of "hello" is equal to "Hello": - +p 'hello' == 'Hello' # YOU DO: log to the console the result of 3 is not equal to 4: - +p 3 == 4 # YOU DO: log to the console the result of 4 is less than or equal to 5: +p 4 <= 5 diff --git a/section1/exercises/interpolation.rb b/section1/exercises/interpolation.rb index 2988c5181..4dd8eb9f8 100644 --- a/section1/exercises/interpolation.rb +++ b/section1/exercises/interpolation.rb @@ -15,16 +15,20 @@ speedy = "quick red fox" slow_poke = "lazy brown dog" -p # YOUR CODE HERE +p "The #{speedy} jumped over the #{slow_poke}" # Write code that uses the variables below to form a string that reads # "In a predictable result, the tortoise beat the hare!": slow_poke = "tortoise" speedy = "hare" -# YOUR CODE HERE +p "In a predictable result, the #{slow_poke} beat the #{speedy}!" # YOU DO: # Declare three variables, name/content/data type of your choice. Think carefully about what you name the variables. Remember, the goal is to be concise but descriptive (it's a hard balance!) Then, log out ONE sentence that incorporates all THREE variables. +name = "kevins" +style = "awesome" +color = "blue" +p "Did you see #{name} new hair cut! It was so #{style}, I liked that he dyed it #{color}!" diff --git a/section1/exercises/loops.rb b/section1/exercises/loops.rb index e8e69523e..bf13ea136 100644 --- a/section1/exercises/loops.rb +++ b/section1/exercises/loops.rb @@ -10,13 +10,17 @@ # Write code that prints the sum of 2 plus 2 seven times: 7.times do - # YOUR CODE HERE + p 2+2 end # Write code that prints the phrase 'She sells seashells down by the seashore' # ten times: -# YOUR CODE HERE +10.times do + p "She sells seashells down by the seashore" +end # Write code that prints the result of 5 + 7 a total of 9 timees -# YOUR CODE HERE +9.times do + p 5+7 +end diff --git a/section1/exercises/numbers.rb b/section1/exercises/numbers.rb index 91435ffb2..c73331d5a 100644 --- a/section1/exercises/numbers.rb +++ b/section1/exercises/numbers.rb @@ -7,10 +7,10 @@ p 2 + 2 # Write code that prints the result of 7 subtracted from 83: -p #YOUR CODE HERE +p 83 - 7 # Write code that prints the result of 6 multiplied by 53: -# YOUR CODE HERE +p 53 * 6 # Write code that prints the result of the modulo of 10 into 54: -# YOUR CODE HERE +p 54 % 10 diff --git a/section1/exercises/strings.rb b/section1/exercises/strings.rb index b514a5a63..43821b0bd 100644 --- a/section1/exercises/strings.rb +++ b/section1/exercises/strings.rb @@ -7,9 +7,10 @@ p "Alan Turing" # Write code that prints `Welcome to Turing!` to the terminal: -p #YOUR CODE HERE +p 'Welcome to Turing!' # Write code that prints `99 bottles of pop on the wall...` to the terminal: -# YOUR CODE HERE +p "99 bottles of pop on the wall..." -# Write out code to log one line from your favorite song or movie. \ No newline at end of file +# Write out code to log one line from your favorite song or movie. +p " Mr. World wide. DALE! " diff --git a/section1/exercises/variables.rb b/section1/exercises/variables.rb index d765e886a..9b83245b8 100644 --- a/section1/exercises/variables.rb +++ b/section1/exercises/variables.rb @@ -1,6 +1,6 @@ # In the below exercises, write code that achieves # the desired result. To check your work, run this -# file by entering the following command in your terminal: +# file by entering the following command in your terminal: # `ruby section1/exercises/variables.rb` # Example: Write code that saves your name to a variable and @@ -11,49 +11,64 @@ # Write code that saves the string 'Dobby' to a variable and # prints what that variable holds to the terminal: house_elf = "Dobby" -# YOUR CODE HERE +p house_elf # Write code that saves the string 'Harry Potter must not return to Hogwarts!' # and prints what that variable holds to the terminal: -# YOUR CODE HERE +harry = "Harry Potter must not return to Hogwarts!" +p harry # Write code that adds 2 to the `students` variable and # prints the result: students = 22 -# YOUR CODE HERE +students = 22 + 2 p students # Write code that subracts 2 from the `students` variable and # prints the result: -# YOUR CODE HERE +students = 22 - 2 p students # YOU DO: -# Declare three variables, named `first_name`, `is_hungry` and `number_of_pets`. +# Declare three variables, named `first_name`, `is_hungry` and `number_of_pets`. # Store the appropriate data types in each. # print all three variables to the terminal. +first_name = 'adrian' +is_hungry = true +number_of_pets = 2 +p first_name +p is_hungry +p number_of_pets # IN WORDS: -# How did you decide to use the data type you did for each of the three variables above? +# How did you decide to use the data type you did for each of the three variables above? # Explain. +# I decided to use the data type string for the first because it is a collection of character, the 2nd I used a boolean because it is true or false, and the 3rd i used integer because it is a number # YOU DO: # Re-assign the values to the three variables from the previous challenge to different values (but same data type). # print all three variables to the terminal. +first_name = 'mark' +is_hungry = false +number_of_pets = 4 +p first_name +p is_hungry +p number_of_pets # YOU DO: # Using the variables below, print the total number of snacks to the terminal: healthy_snacks = 6; junk_food_snacks = 8; - +p healthy_snacks + junk_food_snacks #------------------- # FINAL CHECK #------------------- -# Did you run this file in your terminal to make sure everything printed out to the terminal - # as you would expect? \ No newline at end of file +# Did you run this file in your terminal to make sure everything printed out to the terminal + # as you would expect? +# Yes I did! diff --git a/section1/reflection.md b/section1/reflection.md index 7ce0895a6..042690279 100644 --- a/section1/reflection.md +++ b/section1/reflection.md @@ -1,19 +1,30 @@ ## Section 1 Reflection 1. How did the SuperLearner Article resonate with you? What from this list do you already do? Want to start doing or do more of? Is there anything not on this list, that you would add to it? +The superlearner article resonated with me because I want to be successful in this program and it gave me good tips on how to do this. From the list, I already view learning as a process. I know learing something new is hard, and takes time as well as patitence. I want to start doing more of taking short breaks because I often will sit at the computer for hours and burn myself out. The only thing I would add on this list is re read the instructions 3 or 4 times over before starting so you truly understand what the task is asking for. 1. How would you print the string `"Hello World!"` to the terminal? +p "Hello World!" 1. What character is used to indicate comments in a ruby file? + # the hashtag im currently using 1. Explain the difference between an integer and a float? + integer is just a whole number like 10, float has a decimal like 10.1 1. In the space below, create a variable `animal` that holds the string `"zebra"` + animal = "Zebra" 1. How would you print the string `"zebra"` using the variable that you created above? + puts = animal -1. What is interpolation? Use interpolation to print a sentence using the variable `animal`. +1. What is interpolation? Use interpolation to print a sentence using the variable + `animal`. + p "Have you ever seen a #{animal} that color before?!" 1. What method is used to get input from a user? + gets.chomp -1. Name and describe two common string methods: \ No newline at end of file +1. Name and describe two common string methods: + .length counts the amount of characters in a strings + interploation combine two strings together From 04e743c2a29587b3c3c6b76760162ce6194d8de2 Mon Sep 17 00:00:00 2001 From: Adrian Campos Date: Thu, 28 Oct 2021 02:46:58 -0700 Subject: [PATCH 2/6] Add section 2 work --- section2/exercises/conditionals.rb | 11 ++++ section2/exercises/else_and_if.rb | 54 +++++++++++++++++++ section2/exercises/if_statements.rb | 23 +++++--- section2/exercises/intro_to_methods.rb | 25 +++++++++ section2/exercises/making_decisions.rb | 39 ++++++++++++++ section2/exercises/methods.rb | 41 ++++++++++---- .../exercises/methods_and_return_values.rb | 37 +++++++++++++ section2/exercises/methods_and_variables.rb | 40 ++++++++++++++ section2/exercises/methodsex1.rb | 20 +++++++ section2/exercises/what_if.rb | 44 +++++++++++++++ section2/reflection.md | 40 +++++++++++++- 11 files changed, 356 insertions(+), 18 deletions(-) create mode 100644 section2/exercises/conditionals.rb create mode 100644 section2/exercises/else_and_if.rb create mode 100644 section2/exercises/intro_to_methods.rb create mode 100644 section2/exercises/making_decisions.rb create mode 100644 section2/exercises/methods_and_return_values.rb create mode 100644 section2/exercises/methods_and_variables.rb create mode 100644 section2/exercises/methodsex1.rb create mode 100644 section2/exercises/what_if.rb diff --git a/section2/exercises/conditionals.rb b/section2/exercises/conditionals.rb new file mode 100644 index 000000000..6af176c30 --- /dev/null +++ b/section2/exercises/conditionals.rb @@ -0,0 +1,11 @@ +def water_status(minutes) + if minutes < 7 + puts "The water is not boiling yet." + elsif minutes == 7 + puts "It's just barely boiling" + elsif minutes == 8 + puts "It's boiling!" + else + puts "Hot! Hot! Hot!" + end +end diff --git a/section2/exercises/else_and_if.rb b/section2/exercises/else_and_if.rb new file mode 100644 index 000000000..24f40563d --- /dev/null +++ b/section2/exercises/else_and_if.rb @@ -0,0 +1,54 @@ +people = 45 +cars = 40 +trucks = 15 + +# if cars are greather than people +if cars > people + # prints we should take the cars. + puts "We should take the cars." + # if cars is less than people +elsif cars < people + # prints We should not take the cars. + puts "We should not take the cars." + # if those twos criteria aren't met, then print this statement +else + # Prints We can't decide. + puts "We can't decide." + # ends the if, elsif, else, arguement +end + +# if trucks is greater than cars +if trucks > cars + # Prints "That's too many trucks." + puts "That's too many trucks." + # if trucks is less than cars +elsif trucks < cars + # Prints Maybe we could take the trucks. + puts "Maybe we could take the trucks." + # if those twos criteria aren't met, then print this statement +else + # Print We still can't decide + puts "We still can't decide." + # end the if, elsif, else arguement +end + +# if people is greater than trucks +if people > trucks + # Print "Alright, let's just take the trucks." + puts "Alright, let's just take the trucks." + # If that condition isn't met, than print this +else + # Prints "Fine, let's just stay home then." + puts "Fine, let's just stay home then." + # Ends the if, else condition +end + +if cars > people || trucks < cars. + puts false +end + + + +# 1). elsif and else are additonals commands being given to the if statement. If this doesn't work, then try elsif, or else. +# 2). changed people to 45 and the first statement changed +# 3). lines 46-50 are the boolean statements diff --git a/section2/exercises/if_statements.rb b/section2/exercises/if_statements.rb index f29c45cdd..4a6eef9d5 100644 --- a/section2/exercises/if_statements.rb +++ b/section2/exercises/if_statements.rb @@ -3,14 +3,14 @@ # file by entering the following command in your terminal: # `ruby section2/exercises/if_statements.rb` -# Example: Using the weather variable below, write code that decides +# Example: Using the weather variable below, write code that decides # what you should take with you based on the following conditions: # if it is sunny, print "sunscreen" # if it is rainy, print "umbrella" # if it is snowy, print "coat" # if it is icy, print "yak traks" - weather = 'snowy' + weather = 'sunny' if weather == 'sunny' p "sunscreen" @@ -35,21 +35,24 @@ # Right now, the program will print # out both "I have enough money for a gumball" and -# "I don't have enough money for a gumball". Write a +# "I don't have enough money for a gumball". Write a # conditional statement that prints only one or the other. # Experiment with manipulating the value held within num_quarters # to make sure both conditions can be achieved. -num_quarters = 0 - +num_quarters = 4 +if num_quarters > 2 puts "I have enough money for a gumball" +elsif num_quarters < 2 puts "I don't have enough money for a gumball" +end + ##################### # Using the variables defined below, write code that will tell you -# if you have the ingredients to make a pizza. A pizza requires +# if you have the ingredients to make a pizza. A pizza requires # at least two cups of flour and sauce. # You should be able to change the variables to achieve the following outputs: @@ -61,5 +64,11 @@ # Experiment with manipulating the value held within both variables # to make sure all above conditions output what you expect. -cups_of_flour = 1 +cups_of_flour = 2 has_sauce = true + +if cups_of_flour >= 2 && has_sauce == true + puts "i can make pizza" + elsif + puts "i cannot make pizza" + end diff --git a/section2/exercises/intro_to_methods.rb b/section2/exercises/intro_to_methods.rb new file mode 100644 index 000000000..c2987d2f8 --- /dev/null +++ b/section2/exercises/intro_to_methods.rb @@ -0,0 +1,25 @@ +# this one is like your scripts with ARGV +def print_two(*args) + arg1, arg2=args + puts "arg1: #{arg1}, arg2: #{arg2}" +end + +# ok, that *args is actually pointless, we can just do things +def print_two_again(arg1, arg2) + puts "arg1: #{arg1}, arg2: #{arg2}" +end + +# this just takes one argument +def print_one(arg1) + puts "arg1: #{arg1}" +end + +# this one takes no arguements +def print_none() + puts "I got nothin'." +end + +print_two("Zed","Shaw") +print_two_again("Zed","Shaw") +print_one("First!") +print_none() diff --git a/section2/exercises/making_decisions.rb b/section2/exercises/making_decisions.rb new file mode 100644 index 000000000..3eebf5c06 --- /dev/null +++ b/section2/exercises/making_decisions.rb @@ -0,0 +1,39 @@ +puts "You enter a dark room with two doors. Do you go through door #1 or door #2?" + +print "> " +door = $stdin.gets.chomp + +if door == "1" + puts "There's a giant bear here eating a cheese cake. What do you do?" + puts "1. Take the cake." + puts "2. Scream at the bear." + + print "> " + bear = $stdin.gets.chomp + + if bear == "1" + puts "The bear eats your face off. Good job!" + elsif bear == "2" + puts "The bear eats your legs off. Good job!" + else + puts "Well, doing %s is probably better. Bear runs away." % bear + end + +elsif door == "2" + puts "You stare into the endless abyss at Cthulhu's retina." + puts "1. Blueberries." + puts "2. Yellow jacket clothespins." + puts "3. Understanding revolvers yelling melodies." + + print "> " + insanity = $stdin.gets.chomp + + if insanity == "1" || insanity == "2" + puts "Your body survives powered by a mind of jello. Good job!" + else + puts "The insanity rots your eyes into a pool of muck. Good job!" + end + +else + puts "You stumble around and fall on a knife and die. Good job!" +end diff --git a/section2/exercises/methods.rb b/section2/exercises/methods.rb index f2517f1b3..29b951216 100644 --- a/section2/exercises/methods.rb +++ b/section2/exercises/methods.rb @@ -12,19 +12,42 @@ def print_name # Write a method that takes a name as an argument and prints it: def print_name(name) - # YOUR CODE HERE + p name end print_name("Albus Dumbledore") -# Write a method that takes in 2 numbers as arguments and prints +# Write a method that takes in 2 numbers as arguments and prints # their sum. Then call your method three times with different arguments passed in: -# YOUR CODE HERE -# Write a method that takes in two strings as arguments and prints -# a concatenation of those two strings. Example: The arguments could be -# (man, woman) and the end result might output: "When Harry Met Sally". -# Then call your method three times with different arguments passed in. + +def numbers(num1, num2) + puts "#{num1} + #{num2}" + return num1 + num2 +end + + +numbers = numbers(10,5) +puts "Sum is #{numbers}" +numbers = numbers(15,20) +puts "Sum is #{numbers}" +numbers = numbers(30,30) +puts "Sum is #{numbers}" + + + +# Write a method that takes in two strings as arguments and prints +# a concatenation of those two strings. Example: The arguments could be +# (man, woman) and the end result might output: "When Harry Met Sally". +# Then call your method three times with different arguments passed in. + +def animal(pet1, pet2) + puts " The best pet is a #{pet1}, however it may also be a #{pet2}" +end + +animal("dog", "cat") +animal("tiger", "lion") +animal("zebra", "horse") #------------------- @@ -37,5 +60,5 @@ def print_name(name) # Look at the code you wrote for the previous YOU DO🎈 - what did you name the function, and why? # What did you name each parameter, and why? -# EXPLAIN: - +# EXPLAIN: I named the fuction animal because its easy to understand and relates back to the topic. +# I named the parameter similar to the function because its easy to understand and relates back to the topic. diff --git a/section2/exercises/methods_and_return_values.rb b/section2/exercises/methods_and_return_values.rb new file mode 100644 index 000000000..d57f42112 --- /dev/null +++ b/section2/exercises/methods_and_return_values.rb @@ -0,0 +1,37 @@ +def add(a, b) + puts "ADDING #{a} + #{b}" + return a + b +end + +def subtract(a, b) + puts "SUBTRACTING #{a} - #{b}" + return a - b +end + +def multiply(a, b) + puts "MULTIPLYING #{a} * #{b}" + return a * b +end + +def divide(a, b) + puts "DIVIDING #{a} / #{b}" + return a / b +end + + +puts "Let's do some math with just functions!" + +age = add(30, 5) +height = subtract(78, 4) +weight = multiply(90, 2) +iq = divide(100, 2) + +puts "Age: #{age}, Height: #{height}, Weight: #{weight}, IQ: #{iq}" + + +# A puzzle for the extra credit, type it in anyway. +puts "Here is a puzzle." + +what = add(age, subtract(height, multiply(weight, divide(iq, 2)))) + +puts "That becomes: #{what}. Can you do it by hand?" diff --git a/section2/exercises/methods_and_variables.rb b/section2/exercises/methods_and_variables.rb new file mode 100644 index 000000000..e06615219 --- /dev/null +++ b/section2/exercises/methods_and_variables.rb @@ -0,0 +1,40 @@ +# Defining cheese and crackers variable with two variables in the script +def cheese_and_crackers(cheese_count, boxes_of_crackers) + # Printing you have cheese count variable + puts "You have #{cheese_count} cheeses!" + # Printing you have boxes of crackers variable + puts "You have #{boxes_of_crackers} boxes of crackers!" + # Printing Man that's enough for a party! + puts "Man that's enough for a party!" + # Printing get a blanket and a new line + puts "Get a blanket.\n" + # End the block +end + +# Printing We can just give the function numbers directly: +puts "We can just give the function numbers directly:" +# giving the cheese and crackers variable number respectively, so the 20 would go to the cheese count, and the 30 would go to the box of crackers +cheese_and_crackers(20,30) + + +# Printing Or, we can use variables from our script: +puts "OR, we can use variables from our script:" +# Uses variables from script and changes number for amount of cheese +amount_of_cheese = 10 +# Uses variable from script, changes number for amount of crackers +amount_of_crackers = 50 + +# Prints out the variable cheese_and_crackers with the new amount of chesse and crackers from when we defined it above +cheese_and_crackers(amount_of_cheese, amount_of_crackers) + + +# Prints We can even do math inside too!: +puts "We can even do math inside too:" +# Adding to the cheese and crackers variable respectively, with amount of cheese being 30, and amount of boxes being 11 +cheese_and_crackers(10 + 20, 5 + 6) + + +# Prints "And we can combine the two, variables and math" +puts "And we can combine the two, variables and math:" +# Using what we have learned, combines both elements of variables with amount of cheese being added by 100, and amount of crackers being added by 1000 +cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers + 1000) diff --git a/section2/exercises/methodsex1.rb b/section2/exercises/methodsex1.rb new file mode 100644 index 000000000..3c8aa6e1c --- /dev/null +++ b/section2/exercises/methodsex1.rb @@ -0,0 +1,20 @@ +def say(words) + puts words + '.' +end + +say("hello") +say("hi") +say("how are you") +say("I'm fine") + +def hello_someone(name) + puts "#{name} I am" +end + +hello_someone("Sam") + +def hello(greet) + puts greet +end + +hello("Sam I Am") diff --git a/section2/exercises/what_if.rb b/section2/exercises/what_if.rb new file mode 100644 index 000000000..463c10932 --- /dev/null +++ b/section2/exercises/what_if.rb @@ -0,0 +1,44 @@ +people = 35 +cats = 30 +dogs = 15 + +if people < cats + puts "Too many cats! The world is doomed!" +end + +if people < cats + puts true +end + +if people > cats + puts "Not many cats! The world is saved!" +end + +if people < dogs + puts "The world is drooled on!" +end + +if people > dogs + puts "The world is dry!" +end + +dogs += 5 + +if people >= dogs + puts "People are greater than or equal to dogs." +end + +if people <= dogs + puts "People are less than or equal to dogs" +end + +if people == dogs + puts "People are dogs." +end + + +# 1). The if statement is used to make decisions based on what criteria you give it. If these conditions are met, when you may print what is given. In this case, we print too many cats! the world is doomed because there are 20 people and 30 cats which is true. This is why the statement printed that instead of the other Not many cats! The world is saved! +# 2). There are 2 indented spaces to make the code look more clean and consistent. It also allows for nesting with other languages. +# 3). Nothing happens, however, it is convention to do so. +# 4). Yes, you can put boolean expressions into if-statements, I did in line 9 to line 11 +# 5). If you change the initial values for people, cats, and dogs then the if-statements may print the other expressions we gave it as the criteria changed. In this case, I changed people to 35, and the first one chagned from to many cats to Not many cats! The world is saved! diff --git a/section2/reflection.md b/section2/reflection.md index 49f0606df..2b7f2b4fd 100644 --- a/section2/reflection.md +++ b/section2/reflection.md @@ -2,28 +2,64 @@ 1. Regarding the blog posts in Part A, how do you feel about asking questions? Do you tend to ask them too soon, or wait too long, or somewhere in between? +I feel conflicted sometimes when asking questions. Sometimes I know my question isn't silly but I don't want ask the entire group because it may seem silly to someone else. However, with Turing, I feel like everyone is in the same boat and everyone in the slack channel is eager to help if they're able to. I'm getting better at asking for help when I need it. I do tend to wait too long to ask for help because I want to ensure I've exhausted my search or maybe I sometimes might feel embarrassed to ask. I have made some connections to where I feel comfortable asking certain people rather than the entire slack channel and I think that has helped me alot. + ### If Statements 1. What is a conditional statement? Give three examples. +A conditional statement is a statement that is true if the given scenario is correct. An example of this would be if, elsif, and else statement. If the given scenario is correct, print this. If the given scenario isn't correct move onto elsif. elsif works like an if-statement, only if that if-statement if false. Finally, if both conditions are false, use an else statement. Else statement is printed if both the if and elsif conditions aren't met. 1. Why might you want to use an if-statement? +Use an if-statement to narrow down a list or to compare things 1. What is the Ruby syntax for an if statement? +```ruby +x = 3 +if x >= 2 + puts "x is greater than or equal to two" +``` 1. How do you add multiple conditions to an if statement? +To add multiple conditions to an if statement use && which stands for 'and' 1. Provide an example of the Ruby syntax for an if/elsif/else statement: - +```ruby +age = 21 +if age <= 20 + puts "you are too young for this program" +elsif age >= 65 + puts "you are too old for this program" +else + puts "you qualify for this program" +``` 1. Other than an if-statement, can you think of any other ways we might want to use a conditional statement? +Other ways to use a conditional statement is to compare some information to get it to match our data. ### Methods 1. In your own words, what is the purpose of a method? +It's a shorter way to return values instead of rewriting the same code over and over again. 1. Create a method named `hello` that will print `"Sam I am"`. +```ruby +def hello(greet) + puts greet +end +``` +hello("Sam I Am") 1. Create a method named `hello_someone` that takes an argument of `name` and prints `"#{name} I am"`. +```ruby +def hello_someone(name) + puts "#{name} I am" +end + +hello_someone("Sam") +``` + 1. How would you call or execute the method that you created above? +you type its name, so to run this we would type in hello_someone -1. What questions do you have about methods in Ruby? \ No newline at end of file +1. What questions do you have about methods in Ruby? +Not so much questions, just need to keep trying it so the concept is ingrained in my head. I have somewhat a grasp of it. From 426a785b607324d3794bc3cac4e5e3df1d221724 Mon Sep 17 00:00:00 2001 From: Adrian Campos Date: Thu, 28 Oct 2021 21:27:23 -0700 Subject: [PATCH 3/6] Add section 3 --- section3/exercises/arrays.rb | 36 +++++++++++--------- section3/exercises/ex32.rb | 34 +++++++++++++++++++ section3/exercises/ex34.rb | 27 +++++++++++++++ section3/exercises/ex39.rb | 66 ++++++++++++++++++++++++++++++++++++ section3/exercises/hashes.rb | 53 +++++++++++++++++------------ section3/reflection.md | 25 ++++++++++++++ 6 files changed, 203 insertions(+), 38 deletions(-) create mode 100644 section3/exercises/ex32.rb create mode 100644 section3/exercises/ex34.rb create mode 100644 section3/exercises/ex39.rb diff --git a/section3/exercises/arrays.rb b/section3/exercises/arrays.rb index f710c6000..776c5c476 100644 --- a/section3/exercises/arrays.rb +++ b/section3/exercises/arrays.rb @@ -18,48 +18,54 @@ print animals # EXAMPLE: Write code below that will print "Zebra" from the animals array -# YOUR CODE HERE print animals[0] # YOU DO: Write code below that will print the number of elements in array of # animals from above. - +puts "#{animals.count}" # YOU DO: Write code that will reassign the last item in the animals # array to "Gorilla" +print animals.push("Gorilla") # YOU DO: Write code that will add a new animal (type of your choice) to position 3. - +print animals.insert(3, 'Cat') # YOU DO: Write code that will print the String "Elephant" in the animals array - +print animals[2] #------------------- # PART 2: Foods: Array Methods #------------------- # YOU DO: Declare a variable that will store an an array of at least 4 foods (strings) - +pantry = ["snacks", "bread", "cans", "coffee"] # YOU DO: Write code below that will print the number of elements in the array of # foods from above. - +print "#{pantry.count}" # YOU DO: Write code below that uses a method to add "broccoli" to the foods array and # print the changed array to verify "broccoli" has been added - +print pantry.insert(1, "broccoli") # YOU DO: Write code below that removes the last item of food from the foods array and # print the changed array to verify that item has been removed +pantry.pop +print pantry - -# YOU DO: Write code to add 3 new foods to the array. +# YOU DO: Write code to add 3 new foods to the array. # There are several ways to do this - choose whichever you'd like! # Then, print the changed array to verify the new items have been added +pantry.push("jerky") +pantry << "cereal" +pantry.insert(1, "sasuage") +print pantry # YOU DO: Remove the food that is in index position 0. - +pantry.delete_at(0) +print pantry #------------------- # PART 3: Where are Arrays used? #------------------- @@ -77,11 +83,9 @@ posts = ["image at beach", "holiday party", "adorable puppy", "video of cute baby"]; # YOU DO: Think of a web application you commonly use. Where do you see LISTS utilized, where arrays -# may be storing data? Come up with 3 examples - they could be from different web applications or +# may be storing data? Come up with 3 examples - they could be from different web applications or # all from the same one. -# 1: -# 2: -# 3: - - +# 1: Youtube with its liked videos. It stores all the videos you have liked in an array +# 2: Spotify with your playlists. Playlists are stored in an array with all the songs you saved in that playlist +# 3: Youtube with the your subscriptions list. Everyone you have subscribed to has been saved in a list for you to access. diff --git a/section3/exercises/ex32.rb b/section3/exercises/ex32.rb new file mode 100644 index 000000000..333bf247c --- /dev/null +++ b/section3/exercises/ex32.rb @@ -0,0 +1,34 @@ +the_count = [1, 2, 3, 4, 5] +fruits = ['apples', 'oranges', 'pears', 'apricots'] +change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] + +# this first kind of for-loop goes through a LISTS +# in a more traditional style found in other languages +the_count.each do |number| + puts "This is count #{number}" +end + +# same as above, but in more Ruby style +# this and the next one are preferred +# way Ruby for-loops are written +fruits.each do |fruit| + puts "A fruit of type: #{fruit}" +end + +# also we can go through mixed lists too +# note this is yet another style, exactly like above +# but a different syntax (way to write it). +change.each {|i| puts "I got #{i}" } + +# we can also build lists, first start with an empty one +elements = [] + +# then use the range operator to do 0 to 5 counts +(0..5).each do |i| + puts "adding #{i} to the list." + # pushes the i variable to the *end* of the list + elements << i +end + +# now we can print them out too +elements.each {|i| puts "Element was: #{i}" } diff --git a/section3/exercises/ex34.rb b/section3/exercises/ex34.rb new file mode 100644 index 000000000..df9cb68b2 --- /dev/null +++ b/section3/exercises/ex34.rb @@ -0,0 +1,27 @@ +animals = ['bear', 'ruby', 'peacock', 'kangaroo', 'whale', 'platypus'] + +# The animal at 1. +# Cardinal, positin at 1, so the animal would be Ruby + +# The third (3rd) animals +# Ordinal, so 3-1=2, position is 2, the animal would be peacock + +# The first (1st) animal +# Ordinal, so 1-1=0, position is 0, the animal would be a bear + +# The animal is at 3 +# Cardinal, position at 3, so the animal would be kangaroo + +# The fifth (5th) animal +# Ordinal, so 5-1=4, position is 4, so the animal would be a whale + +# The animal at 2 +# Cardinal, position at 2, so the animal would be peacock + +# The sixth (6th) animal +# Ordinal, so 6-1=5, position at 5, the animal would be a platypus + +# The animal at 4 +# Cardinal, position at 4, so the animal would be whale + +puts animals = animals[4] diff --git a/section3/exercises/ex39.rb b/section3/exercises/ex39.rb new file mode 100644 index 000000000..1adad01bb --- /dev/null +++ b/section3/exercises/ex39.rb @@ -0,0 +1,66 @@ +# create a mapping of state to avreviation +states = { + 'Oregon' => 'OR', + 'Florida' => 'FL', + 'California' => 'CA', + 'New York' => 'NY', + 'Michigan' => 'MI', +} + +# create a basic set of states and some cities in them +cities = { + 'CA' => 'San Francisco', + 'MI' => 'Detriot', + 'FL' => 'Jacksonville', +} + +# add some more cities +cities['NY'] = 'New York' +cities['OR'] = 'Portland' + +# puts out some cities +puts '_' * 10 +puts "NY state has: #{cities['NY']}" +puts "OR state has: #{cities['OR']}" + +# puts some states +puts '_' * 10 +puts "Michigan's abbreviatoin is: #{states['Michigan']}" +puts "Florida's abbreviation is: #{states['Florida']}" + +# do it by using the state then cities indicated +puts '_' * 10 +puts "Michigan has: #{cities[states['Michigan']]}" +puts "Florida has: #{cities[states['Florida']]}" + +# puts every state abbreviation +puts '_' * 10 +states.each do |state, abbrev| + puts "#{state} is abbreviated #{abbrev}" +end + +# puts every city in states +puts '_' * 10 +cities.each do |abbrev, city| + puts "#{abbrev} has the city #{city}" +end + +# now do both at the same Sometimes +puts '_' * 10 +states.each do |state, abbrev| + city = cities[abbrev] + puts "#{state} is abbreviated #{abbrev} and has city #{city}" +end + +puts '_' * 10 +# by default ruby say "nil" when something isn't there +state = states['Texas'] + +if !states + puts "Sorry, no Texas." +end + +# default values using || = with the nil result +city = cities['TX'] +city ||= 'Does not Exist' +puts "The city for the state 'Tx' is #{city}" diff --git a/section3/exercises/hashes.rb b/section3/exercises/hashes.rb index 9d368c753..005d9a722 100644 --- a/section3/exercises/hashes.rb +++ b/section3/exercises/hashes.rb @@ -1,6 +1,6 @@ # In the below exercises, write code that achieves # the desired result. To check your work, run this -# file by entering the following command in your terminal: +# file by entering the following command in your terminal: # `ruby section3/exercises/hashes.rb` # Example: Write code that prints a hash holding grocery store inventory: @@ -8,24 +8,24 @@ p foods # Write code that prints a hash holding zoo animal inventory: -zoo = #YOUR CODE HERE +zoo = {penguins: 14, lions: 25, tigers: 34, gorillas: 12} p zoo -# Write code that prints all of the 'keys' of the zoo variable +# Write code that prints all of the 'keys' of the zoo variable # you created above: -# YOUR CODE HERE +print zoo.keys -# Write code that prints all of the 'values' of the zoo variable +# Write code that prints all of the 'values' of the zoo variable # you created above: -# YOUR CODE HERE +print zoo.values -# Write code that prints the value of the first animal of the zoo variable -# you created above: -# YOUR CODE HERE +# Write code that prints the value of the first animal of the zoo variable +puts "#{zoo[:penguins]}" -# Write code that adds an animal to the zoo hash. +# Write code that adds an animal to the zoo hash. # Then, print the updated hash: -# YOUR CODE HERE +zoo["elephant"] = 5 +puts zoo #------------------- @@ -38,18 +38,27 @@ # Declare a variable that stores hash. Each key should be an attribute of an email and each # value should be some appropriate value for that key. Work to have at least 5 key-value pairs. - +email = { + 'sender' => 'david', + 'subject' => 'coffee', + 'date' => 'august 10th', + 'recipient' => 'john', + 'attachments' => 'none' +} # Write code that prints your email hash to the terminal. +puts email -# Write code that prints all of the 'keys' of the email hash + +# Write code that prints all of the 'keys' of the email hash # you created above: -# YOUR CODE HERE -# Write code that prints all of the 'values' of the email hash +print email.keys + +# Write code that prints all of the 'values' of the email hash # you created above: -# YOUR CODE HERE +print email.values #------------------- # Part 3: Many Emails - OPTIONAL EXTENSION @@ -64,7 +73,7 @@ # posts = ["image at beach", "holiday party", "adorable puppy", "video of cute baby"]; -# Frankly, that was a very simplified version of the Array the Instagram developers have +# Frankly, that was a very simplified version of the Array the Instagram developers have # written and work with. Still probably slightly simplified as we don't know what their code # actually looks like, but it may look more like this: @@ -76,7 +85,7 @@ 'timestamp' => "4:37 PM August 13, 2019", 'number_likes' => 0, 'comments' => [] - }, + }, { 'image_src' => "./images/holiday-party.png", 'caption' => "What a great holiday party omg", @@ -90,12 +99,12 @@ puts posts[0] -# The code snippet above shows an Array with 2 elements. Each element in an -# Object Literal. Each of those Object Literals has 4 key-value pairs. This may LOOK +# The code snippet above shows an Array with 2 elements. Each element in an +# Object Literal. Each of those Object Literals has 4 key-value pairs. This may LOOK # a bit daunting - it's OK! You don't need to be 100% comfortable with this, but it's # good to have some exposure before going into Mod 1. -# YOU DO: Create an array of at least 3 EMAIL Object Literals, using the same +# YOU DO: Create an array of at least 3 EMAIL Object Literals, using the same # key-value pairs you used in your email Object above. -# Then, log the email Array to the console. \ No newline at end of file +# Then, log the email Array to the console. diff --git a/section3/reflection.md b/section3/reflection.md index cda726fd3..31755830a 100644 --- a/section3/reflection.md +++ b/section3/reflection.md @@ -2,16 +2,41 @@ 1. What are two points from the Growth Mindset article and/or video that either resonated with you, or were brand new to you? +1). A point that resonated with me from the growth mindset article was doing the S.M.A.R.T goal setting technique. Often times when I try to do something new or challenging my goals will be either too vague or too unrealistic. This method allows for setting specific, measurable, achievable, relevant, and time bound goals. This is the everything I need in order to be successful here at turing and I will take it with me and apply throughout the course. + +2). A brand new point the growth mindset article was to always be striving to push yourself with something that may seem daunting or out of scope, but in reality is able to be done with a little bit of elbow grease. Not everything is supposed to come easily and WILL take some practice. If everything was easy and comfortable no growth will come with that. There needs to be some struggle to grow. You need to be pushed in order to become more and more proficient. + 1. In which ways do you currently demonstrate a Growth Mindset? In which ways do you _not_? +I feel as if I do have some qualities of the growth mindset such as understanding that it'll not always be easy or come naturally. Sometimes you will need to mess up or not understand something and go back several times and reread or rewrite something in order to continue. There need to be errors so you can see what you did wrong and how to improve. + +I don't possess all the growth mindset qualities that I would like such as seeking help as much as I would like. I enjoy being able to do something myself, however, I am starting to realize that asking for help is only beneficial for both parties involved. If I am stuck on something and someone who has more knowledge or understands the subject differently than I do is able to explain it to me differently, it not only helps me to understand a different perspective or way to do something, it also allows for them to hone their skills and really understand something. If you can explain how something is done or why its done a certain way, then you really understand the concept. + 1. What is a Hash, and how is it different from an Array? +An array is an order based index based on integers. To call something from an array, you need to call it with cardinal based numbers, starting from 0. A hash is similar to an array, however, you can call from within the index with set keys. A hash has key-value pairs that are used to call from within. If you make a hash such as food, a key for example could be amount of pasta, and the value for that would be 2 boxes. Instead of using a number to call from the index, you would use the key word pasta. + 1. In the space below, create a Hash stored to a variable named `pet_store`. This hash should hold an inventory of items and the number of that item that you might find at a pet store. +```ruby +pet_store = {dog_food: 25, cat_food: 30, dog_toys: 140, cat_toys: 110} +``` + 1. Given the following `states = {"CO" => "Colorado", "IA" => "Iowa", "OK" => "Oklahoma"}`, how would you access the value `"Iowa"`? +```ruby +states["IA"] +``` + 1. With the same hash above, how would we get all the keys? How about all the values? +```ruby +print states.keys +print states.values +``` 1. What is another example of when we might use a hash? In your example, why is a hash better than an array? +We might want to use a hash when making a list of things and need to store the value or amount of things inside the list such as taking inventory of a warehouse. A hash is better than an array because you can be much more specific about certain aspects, and name the variables with the key-value pairing that the hash provides. + 1. What questions do you still have about hashes? +None yet. I think I understand this section well. Just may need some more practice will adding new variables or printing out variables without checking my notes. From 45501ed6a6e0b996655d7030bc86046767c36744 Mon Sep 17 00:00:00 2001 From: Adrian Campos Date: Sat, 30 Oct 2021 02:36:10 -0700 Subject: [PATCH 4/6] Add section 4 --- section4/exercises/burrito.rb | 24 +++++++- section4/exercises/classes_and_objects.rb | 58 +++++++++++++++++++ section4/exercises/classes_define_objects.rb | 44 ++++++++++++++ section4/exercises/dog.rb | 7 ++- .../exercises/objects_attributes_methods.rb | 15 +++++ section4/exercises/person.rb | 25 +++++++- section4/exercises/what_are_objects.rb | 6 ++ section4/reflection.md | 39 ++++++++++++- 8 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 section4/exercises/classes_and_objects.rb create mode 100644 section4/exercises/classes_define_objects.rb create mode 100644 section4/exercises/objects_attributes_methods.rb create mode 100644 section4/exercises/what_are_objects.rb diff --git a/section4/exercises/burrito.rb b/section4/exercises/burrito.rb index 967f68b6c..b0939ac9a 100644 --- a/section4/exercises/burrito.rb +++ b/section4/exercises/burrito.rb @@ -1,4 +1,4 @@ -# Add the following methods to this burrito class and +# Add the following methods to this burrito class and # call the methods below the class: # 1. add_topping # 2. remove_topping @@ -6,14 +6,34 @@ class Burrito attr_reader :protein, :base, :toppings - def initialize(protein, base, toppings) + attr_accessor :add_topping, :remove_topping, :change_protein + def initialize(protein, base, toppings) @protein = protein @base = base @toppings = toppings end + +def add_topping(add_topping) + self.add_topping = add_topping + puts "You added #{add_topping} to your burrito." +end + +def remove_topping(remove_topping) + self.remove_topping = remove_topping + puts "You removed #{remove_topping} from your burrito." +end + +def change_protein(change_protein) + self.change_protein = change_protein + puts "You changed the protein #{change_protein} from your burrito." +end end dinner = Burrito.new("Beans", "Rice", ["cheese", "salsa", "guacamole"]) p dinner.protein p dinner.base p dinner.toppings + +puts dinner.add_topping('veggies') +puts dinner.remove_topping('cheese') +puts dinner.change_protein('brisket') diff --git a/section4/exercises/classes_and_objects.rb b/section4/exercises/classes_and_objects.rb new file mode 100644 index 000000000..560473818 --- /dev/null +++ b/section4/exercises/classes_and_objects.rb @@ -0,0 +1,58 @@ +#Initializing a New Object +class GoodDog + def initialize + puts "This object was initialized!" + end +end + +sparky = GoodDog.new # "This object was initialized!" + +#Instance Variables +class GoodDog + def initialize(name) + @name = name + end +end +sparky = GoodDog.new("Sparky") + +#Instance Methods +class GoodDog + def initialize(name) + @name = name + end + + def speak + "Arf!" + end +end + +sparky = GoodDog.new("Sparky") +sparky.speak +puts sparky.speak # will put arf +fido = GoodDog.new("Fido") +puts fido.speak # will put arf +def speak + "#{@name} says arf!" +end +puts sparky.speak # "Sparky says arf!" +puts fido.speak # "Fido says arf!" + + +#Accessor Methods +class GoodDog + def initialize(name) + @name = name + end + + def name # This was renamed from "get_name" + @name + end + + def name=(n) # This was renamed from "set_name=" + @name = n + end + + def speak + "#{@name} says arf!" + end +end diff --git a/section4/exercises/classes_define_objects.rb b/section4/exercises/classes_define_objects.rb new file mode 100644 index 000000000..5ef665206 --- /dev/null +++ b/section4/exercises/classes_define_objects.rb @@ -0,0 +1,44 @@ +class GoodDog +end + +sparky = GoodDog.new + + +module Speak + def speak(sound) + puts sound + end +end + +class GoodDog + include Speak +end + +class HumanBeing + include Speak +end + +sparky = GoodDog.new +sparky.speak("Arf!") +bob = HumanBeing.new +bob.speak("Hello!") + +module Speak + def speak(sound) + puts "#{sound}" + end +end + +class GoodDog + include Speak +end + +class HumanBeing + include Speak +end + +puts "---GoodDog ancestors---" +puts GoodDog.ancestors +puts '' +puts "---HumanBeing Ancestors---" +puts HumanBeing.ancestors diff --git a/section4/exercises/dog.rb b/section4/exercises/dog.rb index 03221314d..843204bc1 100644 --- a/section4/exercises/dog.rb +++ b/section4/exercises/dog.rb @@ -1,5 +1,5 @@ # In the dog class below, write a `play` method that makes -# the dog hungry. Call that method below the class, and +# the dog hungry. Call that method below the class, and # print the dog's hunger status. class Dog @@ -16,6 +16,10 @@ def bark p "woof!" end + def play + @hungry = true + end + def eat @hungry = false end @@ -28,3 +32,4 @@ def eat p fido.hungry fido.eat p fido.hungry +p fido.play diff --git a/section4/exercises/objects_attributes_methods.rb b/section4/exercises/objects_attributes_methods.rb new file mode 100644 index 000000000..c2b8ddecc --- /dev/null +++ b/section4/exercises/objects_attributes_methods.rb @@ -0,0 +1,15 @@ +class Student + attr_accessor :first_name, :last_name, :primary_phone_number + + def introduction(target) + puts "Hi #{target}, I'm #{first_name}!" + end + +def favorite_number + 7 + end +end + +frank = Student.new +frank.first_name = "Frank" +puts "Frank's favorite number is #{frank.favorite_number}." diff --git a/section4/exercises/person.rb b/section4/exercises/person.rb index 2c26e9570..1f7f504f7 100644 --- a/section4/exercises/person.rb +++ b/section4/exercises/person.rb @@ -1,5 +1,26 @@ -# Create a person class with at least 2 attributes and 2 behaviors. +# Create a person class with at least 2 attributes and 2 behaviors. # Call all person methods below the class and print results # to the terminal that show the methods in action. -# YOUR CODE HERE +class Person + attr_reader :height, :shoe_size + def initialize(height, shoe_size) + @height = height + @shoe_size = shoe_size + end + +def talks + "hello!" +end + +def action + "running" +end +end + + +james = Person.new("5'8", 12) +puts james.height +puts james.shoe_size +puts james.talks +puts james.action diff --git a/section4/exercises/what_are_objects.rb b/section4/exercises/what_are_objects.rb new file mode 100644 index 000000000..37f7be3b4 --- /dev/null +++ b/section4/exercises/what_are_objects.rb @@ -0,0 +1,6 @@ +"hello".class +=> string +"world".class +=> string + +# used the class method to determine the class for each object diff --git a/section4/reflection.md b/section4/reflection.md index 68b044b00..43405547c 100644 --- a/section4/reflection.md +++ b/section4/reflection.md @@ -2,21 +2,58 @@ 1. How different did your workflow feel this week, considering we asked you to follow the Pomodoro technique? +The workflow felt like it was somewhat manageable. I followed this for a bit but when the tasks got harder I got distracted and worked until I was fatigued. I will try to follow the pomodoro technique much more closely as it helps to prevent burnout. + 1. Regarding the work you did around setting intentions in Step 1 of the Pomodoro technique - how did that go? Were you surprised by anything (did you find yourself way more focused than you realized, more distracted that you thought you'd be, estimating times accurately or totally off, etc)? +It went ok. I was surprised by how focused I was at times and how the small breaks can help break the hours of staring at the screens and trying to figure out code. At points I was more distracted at certain times when I didn't follow the technique or if I didn't have a tab up with a timer to follow the technique. + + 1. In your own words, what is a Class? +A class allows for objects to have a category to be named and stored in. 1. What is an attribute of a Class? +An attribute of a class is a definition of something within a class. 1. What is behavior of a Class? +The behavior of a class is an action given to the class. 1. In the space below, create a Dog class with at least 2 attributes and 2 behaviors: + ```rb +class Dog + attr_reader :weight, :color + def initialize(weight, color) + @weight = weight + @shoe_size = color + end + +def breed + "Pitbull" +end + +def bark + "woof!" +end +end + + +luka = Dog.new("50lbs", "White and Brown") +puts luka.weight +puts luka.color +puts luka.breed +puts luka.bark + + + ``` 1. How do you create an instance of a class? +Make a variable and then use method.object_name to create an instance of a class. +An example of this would be dog1= Luka.new -1. What questions do you still have about classes in Ruby? \ No newline at end of file +1. What questions do you still have about classes in Ruby? +I have some questions but I think I just need to revisit the given websites and rewrite my notes so its much more coherent. Right now im a bit scrambled with everything. From 101f29c14a91c896c0483fcb21a3aef8f4c1ca3a Mon Sep 17 00:00:00 2001 From: Adrian Campos Date: Sat, 30 Oct 2021 02:41:04 -0700 Subject: [PATCH 5/6] Add section 4 work --- section4/exercises/burrito.rb | 2 +- section4/reflection.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/section4/exercises/burrito.rb b/section4/exercises/burrito.rb index b0939ac9a..7bbcb88bd 100644 --- a/section4/exercises/burrito.rb +++ b/section4/exercises/burrito.rb @@ -36,4 +36,4 @@ def change_protein(change_protein) puts dinner.add_topping('veggies') puts dinner.remove_topping('cheese') -puts dinner.change_protein('brisket') +puts dinner.change_protein('carne asada') diff --git a/section4/reflection.md b/section4/reflection.md index 43405547c..49f65a918 100644 --- a/section4/reflection.md +++ b/section4/reflection.md @@ -6,7 +6,7 @@ The workflow felt like it was somewhat manageable. I followed this for a bit but 1. Regarding the work you did around setting intentions in Step 1 of the Pomodoro technique - how did that go? Were you surprised by anything (did you find yourself way more focused than you realized, more distracted that you thought you'd be, estimating times accurately or totally off, etc)? -It went ok. I was surprised by how focused I was at times and how the small breaks can help break the hours of staring at the screens and trying to figure out code. At points I was more distracted at certain times when I didn't follow the technique or if I didn't have a tab up with a timer to follow the technique. +It went ok. I was surprised by how focused I was at times and how the small breaks can help break the hours of staring at the screens and trying to figure out code. At points I was more distracted at certain times when I didn't follow the technique or if I didn't have a tab up with a timer to follow the technique! 1. In your own words, what is a Class? @@ -56,4 +56,4 @@ Make a variable and then use method.object_name to create an instance of a class An example of this would be dog1= Luka.new 1. What questions do you still have about classes in Ruby? -I have some questions but I think I just need to revisit the given websites and rewrite my notes so its much more coherent. Right now im a bit scrambled with everything. +I have some questions but I think I just need to revisit the given websites and rewrite my notes so its much more coherent. Right now im a bit scrambled with everything. From 4bd750b337a1ca524d2aaff5f8239bf6b60bee58 Mon Sep 17 00:00:00 2001 From: Adrian Campos Date: Sat, 30 Oct 2021 19:16:28 -0700 Subject: [PATCH 6/6] add final prep --- final_prep/README.md | 40 +++++++------- final_prep/annotations.rb | 42 ++++++++++++--- final_prep/mod_zero_hero.rb | 101 +++++++++++++++++++++++++++++++++--- 3 files changed, 152 insertions(+), 31 deletions(-) diff --git a/final_prep/README.md b/final_prep/README.md index 22bfb5154..8ac6978f3 100644 --- a/final_prep/README.md +++ b/final_prep/README.md @@ -3,13 +3,13 @@ Congrats on making it to the Mod 0 Final Prep! Complete the final exercises belo ### Final Technical Prep -You've learned a ton about some of the core foundations of Javascript! Show us how far you've come by completing the following exercises! You will be using your work from these exercises in your first day of Mod 1! +You've learned a ton about some of the core foundations of Javascript! Show us how far you've come by completing the following exercises! You will be using your work from these exercises in your first day of Mod 1! -- [ ] Complete the [Mod Zero Hero Challenge](./mod_zero_hero.rb) -- [ ] Complete the [Annotation Challenge](./annotations.rb) +- [x] Complete the [Mod Zero Hero Challenge](./mod_zero_hero.rb) +- [x] Complete the [Annotation Challenge](./annotations.rb) ### Refactor Previous Work -You've learned A LOT over the last few weeks as it relates to technical content - chances are, you probably have some code from your previous exercises that is either sloppy, incorrect, poorly named, etc. Before starting Mod 1, we want you to `refactor` your code - which is the process of adjusting or improving your code for readability and accuracy. +You've learned A LOT over the last few weeks as it relates to technical content - chances are, you probably have some code from your previous exercises that is either sloppy, incorrect, poorly named, etc. Before starting Mod 1, we want you to `refactor` your code - which is the process of adjusting or improving your code for readability and accuracy. Some things to consider as you refactor include... - Are my variable names easy to understand/convey the data type they are assigned to? @@ -19,37 +19,41 @@ Some things to consider as you refactor include... Take your time as you go back and refactor your exercises from each section. We've included a handy checklist for you to go through below. -- [ ] I have refactored my `section1` exercises to the best of my ability -- [ ] I have refactored my `section2` exercises to the best of my ability -- [ ] I have refactored my `section3` exercises to the best of my ability -- [ ] I have refactored my `section4` exercises to the best of my ability +- [x] I have refactored my `section1` exercises to the best of my ability +- [x] I have refactored my `section2` exercises to the best of my ability +- [x] I have refactored my `section3` exercises to the best of my ability +- [x] I have refactored my `section4` exercises to the best of my ability ### Time Management Prep In Mod 0 you've learned about different techniques for managing your time at Turing. Please create a calendar for your **first 3 weeks of Mod 1**. Feel free to make your calendar fit your style, but we suggest that your calendar should include the following: -- [ ] Standard M1 class schedule (see M1 calendar [here](https://backend.turing.io/module1/) -- [ ] Study/Project work time -- [ ] Health + Wellness +- [x] Standard M1 class schedule (see M1 calendar [here](https://backend.turing.io/module1/) +- [x] Study/Project work time +- [x] Health + Wellness When you are finished, add screenshots of your calendar so we can provide feedback if needed! -- `Add Week 1 Screenshot Here` +- `Add Week 1 Screenshot Here`![Screen Shot 2021-10-30 at 5 33 10 PM](https://user-images.githubusercontent.com/89896053/139562001-2f3dbd6f-4453-4c2b-aa18-894a005de6bf.png + - `Add Week 2 Screenshot Here` -- `Add Week 3 Screenshot Here` +![Screen Shot 2021-10-30 at 5 33 46 PM](https://user-images.githubusercontent.com/89896053/139562004-23dc9db4-1d0b-44ac-9df8-d6936a6db1e6.png) + +- `Add Week 3 Screenshot Here`![Screen Shot 2021-10-30 at 5 34 00 PM](https://user-images.githubusercontent.com/89896053/139562011-a15b429f-5b2e-43ec-b8e0-60bac9d6a13b.png) + ### Mentorship Prep Mentorship is an integral part of the Turing experience and will help jumpstart your technical career. In order to get your mentor relationship started on the right foot, please complete the following deliverables: -- [ ] Complete the [Mentorship DTR Prep](https://gist.github.com/ericweissman/51965bdcbf42970d43d817818bfaef3c) - - [ ] Add link to your gist here: +- [x] Complete the [Mentorship DTR Prep](https://gist.github.com/ericweissman/51965bdcbf42970d43d817818bfaef3c) + - [x] Add link to your gist here: https://gist.github.com/adriancampos29/68cafb3db0eebb87455f6d73dc36bb68 ### Lesson Prep You've learned a lot about how to take strong notes during Mod 0. Show us your skills while you learn how to pre-teach content for your first lesson in Mod 1! - [ ] Complete the [Pre Teaching Practice exercise](https://gist.github.com/ericweissman/0036e8fe272c02bd6d4bb14f42fd2f79) gist - - [ ] Add a link to your gist here: + - [ ] Add a link to your gist here: https://gist.github.com/adriancampos29/4f87b2f9a67f246cce2015e135aa95ce ### Group Work Prep As part of Turing's project-based learning approach, you will often be working in pairs or larger groups. In order to set yourself (and your team) up for success, it is important to ensure you are prepared to be an equitable contributor and teammate. - [ ] Complete the [DTR Guiding Questions](https://gist.github.com/ericweissman/c56f3a98cdce761808c21d498a52f5c6) - - [ ] Add a link to your gist here: + - [ ] Add a link to your gist here: https://gist.github.com/adriancampos29/07f9c1e70a090b361464f833b0f862aa ## All Done? How to Submit your M1 Prework When you have completed *all* the activities described above, follow the steps below to submit your technical prework. @@ -86,4 +90,4 @@ What is your plan and how are you going to hold yourself to it? Specifically... - What personal items/events are important to you during this time? How are you going to make sure those are not neglected? (Hint, block time on the calendar for them!) ## Extensions -Check out our thoughts on [extension activities](https://mod0.turing.io/prework/extensions) if you find yourself with some extra time before starting Mod 1! \ No newline at end of file +Check out our thoughts on [extension activities](https://mod0.turing.io/prework/extensions) if you find yourself with some extra time before starting Mod 1! diff --git a/final_prep/annotations.rb b/final_prep/annotations.rb index 8b938706c..53ce8c7e0 100644 --- a/final_prep/annotations.rb +++ b/final_prep/annotations.rb @@ -1,43 +1,71 @@ -# Add your annotations, line by line, to the code below using code comments. +# Add your annotations, line by line, to the code blow using code comments. # Try to focus on using correct technical vocabulary. # Use the # to create a new comment -# Build a Bear - +# Defining a method which is build a bear, with variables inside the parathesis that are given with a command def build_a_bear(name, age, fur, clothes, special_power) + # Setting variable greeting to a string with interpolation greeting = "Hey partner! My name is #{name} - will you be my friend?!" + # setting demographics variable to an array with name and age inside demographics = [name, age] + # Setting variable power saying with a string that has interpolation power_saying = "Did you know that I can #{special_power}?" + # Builidng a hash with built_bear as the name of it built_bear = { + # Basic info is the variable name with demographics being its string value demographics 'basic_info' => demographics, + # Clothes variable set to string value clothes 'clothes' => clothes, + # exterior variable set to string value fur 'exterior' => fur, + # cost variable set to float value 49.99 'cost' => 49.99, + # saying variable is set to an array consisting of two variables and one string value 'sayings' => [greeting, power_saying, "Goodnight my friend!"], + # is cuddly variable set to boolean value true 'is_cuddly' => true, } + # Stores built_bear hash return built_bear + # ends the function end +# Calling the build a bear hash, it is now going to store these variables and functions intho the original 5 that it was given. For example, the fluffy variable will go into the name variable, the 4 interger will go into the age variable, the brown variable will go into fur variable. build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares') -build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in') +# Calling the build a bear hash, it will now store these variables into the original 5 that were given. For example, Sleeply will go into the name variable, the integer 2 will go into the age variable, the variable purple will go into the fur variable. +build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in') -# FizzBuzz +# Defining method fizzbuzz with 3 variables stored in it, num_1, num_2, and range def fizzbuzz(num_1, num_2, range) + # 1..range will compute from the numer 1 to the variable range. .each loops this varaible while do tells it to loop. The |i| is place holder for indexes (1..range).each do |i| + # The if statemenet is stating if i has a remindar equal to num_1 that is equal to 0 AND if i has a remindar equal to num_2 that is equal to zero if i % num_1 === 0 && i % num_2 === 0 + # print fizzbuzz if the given condition above is true puts 'fizzbuzz' + # elsif is stating that if the first condition isn't met, then print this method. This elsif method states if i has a remindar that is equal to num_1 that is equal to 0 elsif i % num_1 === 0 + # Print fizz if the given condition above is true puts 'fizz' - elsif i % num_2 === 0 + # elsif is stating that if the given if statement is false, then go to the next elsif statement. This is stating if i has a remindar equal to num_2 that is equal to= + elsif i % num_2 === 0 + # Print buzz if the given condition above is true puts 'buzz' + # else is the final condition in a if, elsif statement. If the if and elsif statements are false, else will automatically be the final condition. else + # print i if the given conditions of if, elsif are false puts i + # ends the if, elsif, else fuctions end + # ends the looping function end + # ends the method function end +# prints fizzbuzz with the given array in the index we defined earlier, that is i. This will also follow the conditions we gave it earlier, meaning the looping, if, elsif, and else functions. fizzbuzz(3, 5, 100) -fizzbuzz(5, 8, 400) \ No newline at end of file + +# prints fizzbuzz with the given array in the index we defined earlier, that is i. This will also follow the given condtions we gave it earlier meaning the loopings, if, elsif, and else functions. +fizzbuzz(5,8,400) diff --git a/final_prep/mod_zero_hero.rb b/final_prep/mod_zero_hero.rb index 35eb2cdac..757aca710 100644 --- a/final_prep/mod_zero_hero.rb +++ b/final_prep/mod_zero_hero.rb @@ -2,38 +2,68 @@ # Declare two variables - hero_name AND special_ability - set to strings +hero_name = "Spiderman" +special_ability = "spidey sense" + # Declare two variables - greeting AND catchphrase # greeting should be assigned to a string that uses interpolation to include the hero_name # catchphrase should be assigned to a string that uses interpolation to include the special_ability +greeting = "Hello! I am #{hero_name}!" +catchphrase = "I have the ability #{special_ability} that allows me to sense danger!" + + # Declare two variables - power AND energy - set to integers +power = 100 +energy = 110 + # Declare two variables - full_power AND full_energy # full_power should multiply your current power by 500 # full_energy should add 150 to your current energy +full_power = power * 500 +full_energy = energy + 150 + # Declare two variables - is_human and identity_concealed - assigned to booleans +is_human = true +identity_concealed = true # Declare two variables - arch_enemies AND sidekicks # arch_enemies should be an array of at least 3 different enemy strings # sidekicks should be an array of at least 3 different sidekick strings +arch_enemies = ['Green Goblin', 'Doc Oct', 'Sandman'] +sidekicks = ['Captain America', 'Iron Man', 'Thor'] + # Print the first sidekick to your terminal +print sidekicks.first + # Print the last arch_enemy to the terminal +print arch_enemies.last + # Write some code to add a new arch_enemy to the arch_enemies array +arch_enemies.append('Venom') + # Print the arch_enemies array to terminal to ensure you added a new arch_enemey +print arch_enemies + # Remove the first sidekick from the sidekicks array +sidekicks.shift + # Print the sidekicks array to terminal to ensure you added a new sidekick +print sidekicks + # Create a function called assess_situation that takes three arguments - danger_level, save_the_day, bad_excuse # - danger_level should be an integer -# - save_the_day should be a string a hero would say once they save the day +# - save_the_day should be a string a hero would say once they save the day # - bad_excuse should be a string a hero would say if they are too afraid of the danger_level # Your function should include an if/else statement that meets the following criteria @@ -41,6 +71,19 @@ # - Anything danger_level that is between 10 and 50 should result in printing the save_the_day string to the terminal # - If the danger_level is below 10, it means it is not worth your time and should result in printing the string "Meh. Hard pass." to the terminal. +def assess_situation(danger_level, save_the_day, bad_excuse) + if danger_level > 50 + print "#{bad_excuse}" + elsif danger_level = 10..50 + print "#{save_the_day}" + elsif danger_level < 10 + print "meh. hard pass." + end +end + +assess_situation(20, "We did it!", "I gotta go!") + + #Test Cases announcement = 'Never fear, the Courageous Curly Bracket is here!' excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.' @@ -55,17 +98,29 @@ # - citiesDestroyed (array) # - luckyNumbers (array) # - address (hash with following key/values: number , street , state, zip) - +scary_monster = { + 'name' => 'MOUSEMAN', + 'smell' => 'sewer', + 'weight' => 500, + 'citiesDestroyed' => ['Bakersfield', 'Los Angeles', 'Wasco'], + 'luckyNumbers' => [14, 29, 111] +}, +address = { + 'number' => 2212, + 'street' => 'Bay Club Court', + 'state' => 'California', + 'zip' => 93303 +} # Create a new class called SuperHero # - Your class should have the following DYNAMIC values -# - name +# - name # - super_power -# - age +# - age # - Your class should have the following STATIC values # - arch_nemesis, assigned to "The Syntax Error" # - power_level = 100 -# - energy_level = 50 +# - energy_level = 50 # - Create the following class methods # - say_name, should print the hero's name to the terminal @@ -75,10 +130,44 @@ # - Create 2 instances of your SuperHero class +class Superhero +attr_accessor :name, :super_power, :age + attr_reader :arch_nemesis, :power_level, :energy_level +def initialize(arch_nemesis, power_level, energy_level) + @arch_nemesis = "The Syntax Error" +@power_level = 100 +@energy_level = 50 +end + +def say_name(name) + puts name +end + +def maximize_energy + @energy_level = 1000 + puts "Your energy is #{@energy_level} now!" +end + +def gain_power(power) + @power_level += power + puts "You gained #{power} more power" +end +end + +hero1 = Superhero.new("landman", 40, 50) +hero2 = Superhero.new("garbageman", 100, 200) + +puts hero1.gain_power(20) +puts hero2.gain_power(100) +puts hero1.maximize_energy +puts hero1.say_name('aqua man') + # Reflection # What parts were most difficult about this exerise? +#1). The most difficult part of this exercise was class/methods for me. I really need to go back and reread and rework each individual section. I felt like I was just guessing and trying every little thing until it worked and not understanding how it works. This is something I will study heavily going into mod 1 as I feel i'm not as prepared as I need to be. I want to be able to have it down. # What parts felt most comfortable to you? +#2). I woulsd say section 1 and 3 I have the best grasp on. Arrays and hashes I can visulize and dont need to keep plugging in different things to see if my solution is coreect. However section 2 and 4 I will redo the entire portions as I dont have the grasp I would like just yet. I need to understand the ins and outs of those because I know I didnt grasp the concepts well enought to be comfortable explaining them. Espcially section 4 with the classes and methods. This was the thing I had most trouble with. # What skills do you need to continue to practice before starting Mod 1? - +#3). The skills I need to continue to practice are for sure anytning given in section 2 and 4. This includes If, elsif, and else statements. I understand them but want a better grasp. Section 4 is something I will revist and redo in its entirely as I know im not comfortable with it just yet.