Skip to content
Open
12 changes: 6 additions & 6 deletions final_prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ In Mod 0 you've learned about different techniques for managing your time at Tur

When you are finished, add screenshots of your calendar so we can provide feedback if needed!

- `Add Week 1 Screenshot Here`
- `Add Week 2 Screenshot Here`
- `Add Week 3 Screenshot Here`
- `Add Week 1 Screenshot Here` ![directories](https://user-images.githubusercontent.com/95315216/146657851-a3f76877-402f-429b-bef7-470744e785d4.png)
- `Add Week 2 Screenshot Here` ![directories](https://user-images.githubusercontent.com/95315216/146657870-15e21d6b-231f-44a4-b082-595ca2db1075.png)
- `Add Week 3 Screenshot Here` ![directories](https://user-images.githubusercontent.com/95315216/146657876-65c2e4ae-6951-4c86-b280-19568e35f1a3.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:
- [ ] Add link to your gist here: (https://gist.github.com/erock02/89070b920da0b658760b1ab7e1c6a8ec)

### 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/erock02/cde1ffa4642aee7bdc23ab32bd7087c7)

### 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/erock02/89070b920da0b658760b1ab7e1c6a8ec

## 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.
Expand Down
38 changes: 19 additions & 19 deletions final_prep/annotations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@

# Build a Bear

def build_a_bear(name, age, fur, clothes, special_power)
greeting = "Hey partner! My name is #{name} - will you be my friend?!"
demographics = [name, age]
power_saying = "Did you know that I can #{special_power}?"
def build_a_bear(name, age, fur, clothes, special_power) #create build_a_bear function that takes 5 parameters
greeting = "Hey partner! My name is #{name} - will you be my friend?!" #create greeting string variable that interpolates name
demographics = [name, age] #create demographics variable and assign to array
power_saying = "Did you know that I can #{special_power}?" #create power_saying string variable that interpolates special_power
built_bear = {
'basic_info' => demographics,
'clothes' => clothes,
'exterior' => fur,
'cost' => 49.99,
'sayings' => [greeting, power_saying, "Goodnight my friend!"],
'is_cuddly' => true,
}
} #create built_bear hash with 6 key/value pairs
end

build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares')
build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in')
build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares') #create build_a_bear instance
build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in') #create build_a_bear instance


# FizzBuzz

def fizzbuzz(num_1, num_2, range)
(1..range).each do |i|
if i % num_1 === 0 && i % num_2 === 0
puts 'fizzbuzz'
elsif i % num_1 === 0
puts 'fizz'
elsif i % num_2 === 0
puts 'buzz'
else
puts i
def fizzbuzz(num_1, num_2, range) #create fizzbuzz function that takes 3 arguments
(1..range).each do |i| #loop from 1 to range
if i % num_1 === 0 && i % num_2 === 0 #initial condition
puts 'fizzbuzz' #print string
elsif i % num_1 === 0 #else condition
puts 'fizz' #print string
elsif i % num_2 === 0 #else condition
puts 'buzz' #print string
else #else statement
puts i #print current index
end
end
end

fizzbuzz(3, 5, 100)
fizzbuzz(5, 8, 400)
fizzbuzz(3, 5, 100) #create fizzbuzz instance with arguments 3,5,100
fizzbuzz(5, 8, 400) #create fizzbuzz instance with arguments 5,8,400
109 changes: 82 additions & 27 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
@@ -1,41 +1,59 @@
# Challenge - See if you can follow the instructions and complete the exercise in under 30 minutes!

# Declare two variables - hero_name AND special_ability - set to strings

hero_name = "Batman"
special_ability = "being rich"
# 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 = "I'm Batman"
catchphrase = "Bats frighten me. It's time the world share my dread."
# Declare two variables - power AND energy - set to integers

power = 42
energy = 70
# 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_enemy = ["joker", "riddler","penguin"]
sidekicks = ["robin","alfred","gordon"]
# Print the first sidekick to your terminal

p sidekicks[0]
# Print the last arch_enemy to the terminal

p arch_enemy[-1]
# Write some code to add a new arch_enemy to the arch_enemies array

arch_enemy.push("mr.freeze")
# Print the arch_enemies array to terminal to ensure you added a new arch_enemey

p arch_enemy
# Remove the first sidekick from the sidekicks array

sidekicks.pop
# Print the sidekicks array to terminal to ensure you added a new sidekick

p sidekicks
# Create a method 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

# danger_level = 2
# save_the_day = "You're welcome"
# bad_excuse = "today is my day off"

def assess_situation(danger_level, save_the_day, bad_excuse)
if danger_level > 50
puts bad_excuse
elsif (danger_level >= 10 && danger_level <= 50)
puts save_the_day
else
puts "Meh. Hard pass."
end
end
# Your method should include an if/else statement that meets the following criteria
# - Danger levels that are above 50 are too scary for your hero. Any danger level that is above 50 should result in printing the bad_excuse to the terminal
# - Anything danger_level that is between 10 and 50 should result in printing the save_the_day string to the terminal
Expand All @@ -44,9 +62,9 @@
#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.'
# assess_situation(99, announcement, excuse) > Should print - 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'
#assess_situation(21, announcement, excuse) > should print - 'Never fear, the Courageous Curly Bracket is here!'
#assess_situation(3, announcement, excuse) > should print - "Meh. Hard pass."
assess_situation(99, announcement, excuse) # > Should print - 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'
assess_situation(21, announcement, excuse) #> should print - 'Never fear, the Courageous Curly Bracket is here!'
assess_situation(3, announcement, excuse) #> should print - "Meh. Hard pass."

# Declare a new variable - scary_monster - assigned to an hash with the following key/values
# - name (string)
Expand All @@ -55,30 +73,67 @@
# - citiesDestroyed (array)
# - luckyNumbers (array)
# - address (hash with following key/values: number , street , state, zip)

scary_monster = {
name: "fred",
smell: "horrible",
weight: 100,
citiesDestroyed: ["Seattle", "Denver", "New York"],
luckyNumbers: [2, 12, 24],
address: {
number: 42,
street: "P. Sherman",
state: "WA",
zip: 99999
}
}

# 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
class SuperHero
attr_accessor :name, :super_power, :age

@@arch_nemesis = "The Syntax Error"
@@power_level = 100
@@energy_level = 50

def initialize(name, super_power, age)
@name = name
@super_power = super_power
@age = age
end

def say_name
puts "#{@name}"
end

def maximize_energy
@@energy_level = 1000
end

def gain_power(gain)
power_level = @@power_level + gain
puts power_level
end
end
# - Create the following class methods
# - say_name, should print the hero's name to the terminal
# - maximize_energy, should update the energy_level to 1000
# - gain_power, should take an argument of a number and INCREASE the power_level by that number

# - Create 2 instances of your SuperHero class


superman = SuperHero.new("superman", "heat vision", 79)
wonderwoman = SuperHero.new("wonderwoman", "strength", 800)
# Reflection
# What parts were most difficult about this exerise?

#creating the class SuperHero class. I have less experience creating classes.
# What parts felt most comfortable to you?

# the first parts: creating and assigning variable or methods
# What skills do you need to continue to practice before starting Mod 1?

#everything, but definitely want to become more familiar with classes. Maybe my code wasn't efficient since I wasn't 100% sure what my code was doing
5 changes: 3 additions & 2 deletions section1/exercises/booleans.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions section1/exercises/interpolation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"# YOUR CODE HERE

# 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.
my_name = "Eric Espindola"
section = "mod 0"
cohort = 2111

p "My name is #{my_name}, I am currently in #{section}, and my cohort is #{cohort}a"
9 changes: 7 additions & 2 deletions section1/exercises/loops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,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
5 changes: 3 additions & 2 deletions section1/exercises/numbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
p 2 + 2

# Write code that prints the result of 7 subtracted from 83:
p #YOUR CODE HERE
p 7 - 83 #YOUR CODE HERE

# Write code that prints the result of 6 multiplied by 53:
# YOUR CODE HERE

p 6 * 53
# Write code that prints the result of the modulo of 10 into 54:
# YOUR CODE HERE
p 54 % 10
7 changes: 4 additions & 3 deletions section1/exercises/strings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!" #YOUR CODE HERE

# Write code that prints `99 bottles of pop on the wall...` to the terminal:
# YOUR CODE HERE

# Write out code to log one line from your favorite song or movie.
p "99 bottles of pop on the wall..."
# Write out code to log one line from your favorite song or movie.
p "to the windows, to the walls"
Loading