Skip to content
Open
15 changes: 7 additions & 8 deletions final_prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,26 @@ In Mod 0 you've learned about different techniques for managing your time at Tur
- [ ] 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 2 Screenshot Here`
- `Add Week 3 Screenshot Here`
![Screen Shot 2021-11-13 at 9 38 15 AM](https://user-images.githubusercontent.com/93230542/141659725-fddb6ece-dfd7-41d5-897e-669ed65ff1e0.png)
![Screen Shot 2021-11-13 at 9 38 43 AM](https://user-images.githubusercontent.com/93230542/141659762-b8a25e8c-e205-4818-abd9-078b225e81de.png)![Screen Shot 2021-11-13 at 9 39 14 AM](https://user-images.githubusercontent.com/93230542/141659687-8ae4e919-cba5-4ef7-a26a-3e4eed1d8e25.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/conorbarthel/2f49929a060617a177c81bcb7e9e81e3)

### 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:

https://gist.github.com/conorbarthel/9477d015614ef537bc8a425f53cfde83
### 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:
https://gist.github.com/conorbarthel/2a03796006ba601d58193ae2ab0511d3##

## All Done? How to Submit your M1 Prework
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.

1. Go to *your* prework repository on GitHub
Expand Down Expand Up @@ -86,4 +85,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!
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!
32 changes: 27 additions & 5 deletions final_prep/annotations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,63 @@
# Use the # to create a new comment

# Build a Bear

#defines a method build_a_bear with inputs of name, age, fur, clothes, special_power

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more technical way to say this would be "defines a method build_a_bear with parameters of name, age, fur, clothes, special_power"

def build_a_bear(name, age, fur, clothes, special_power)
#saves variable greeting as a string interpolating the name input

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more technical way to say this would be "declare a variable greeting"

greeting = "Hey partner! My name is #{name} - will you be my friend?!"
#saves variable demographics as an array containing name and age inputs
demographics = [name, age]
#saves variable power_saying as a sting interpolating the input special_power
power_saying = "Did you know that I can #{special_power}?"
#saves a hash built_bear
built_bear = {
#next three lines save key value pairs with the keys 'basic_info', 'clothes', and 'exterior'
#assigned to values from the method inputs
'basic_info' => demographics,
'clothes' => clothes,
'exterior' => fur,
#saves key 'cost to a float'
'cost' => 49.99,
#saves key 'sayings' to an array containing inputs and a string
'sayings' => [greeting, power_saying, "Goodnight my friend!"],
#saves key to a boolean
'is_cuddly' => true,
}
#method outputs the hash built_bear
return built_bear
#closes build_a_bear method
end

#two different method calls of the build_a_bear method containing inputs:
#name, age, fur, clothes, special_power
build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares')
build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in')


# FizzBuzz

#defines method fizzbuzz the takes inputs of num_1, num_2, and range
def fizzbuzz(num_1, num_2, range)
#from the intiger 1 to the input of range do the follwing to each of the intigers
(1..range).each do |i|
#if the intiger is divided by num_1 and there is no remainder AND
#if the intiger is divided by num_2 and there is no remainder print the string
#'fizzbuzz'
if i % num_1 === 0 && i % num_2 === 0
puts 'fizzbuzz'
#else if the intiger is divisible by num_1 print the string "fizz"
elsif i % num_1 === 0
puts 'fizz'
#else if the intiger is divisible by num_2 print the sting "buzz"
elsif i % num_2 === 0
puts 'buzz'
#else return the intigers
else
puts i
#closes if/else statement
end
#closes .each method (loop)
end
#closes fizzbuzz method
end

#calls the method fizzbuzz twice with the inputs of num_1, num_2, and range
fizzbuzz(3, 5, 100)
fizzbuzz(5, 8, 400)
fizzbuzz(5, 8, 400)
103 changes: 82 additions & 21 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
# 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 = "Money"
# 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 = "Did someone call #{hero_name}?"
catchphrase = "nananana #{special_ability}"
# Declare two variables - power AND energy - set to integers

power = 50
energy = 20
# 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 = ["The Joker", "Penguin", "Two Face"]
sidekicks = ["Robin", "Gordon", "Alfred"]
# Print the first sidekick to your terminal

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

puts arch_enemies[2]
# Write some code to add a new arch_enemy to the arch_enemies array

arch_enemies.append("Superman")
# 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

puts 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

def assess_situation(danger_level, save_the_day, bad_excuse)
if danger_level > 50
puts "#{bad_excuse}"
elsif danger_level <= 50 && danger_level >= 10
puts "#{save_the_day}"
elsif danger_level < 10
puts "Meh. Hard pass."
else
puts "invalid entry"
end
end
# Your function 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 @@ -47,38 +62,84 @@
# 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)
assess_situation(21, announcement, excuse)
assess_situation(3, announcement, excuse)
# Declare a new variable - scary_monster - assigned to an hash with the following key/values
# - name (string)
# - smell (string)
# - weight (integer)
# - citiesDestroyed (array)
# - luckyNumbers (array)
# - address (hash with following key/values: number , street , state, zip)

scary_monster = {
name: "Dracula",
smell: "blood",
weight: 4,
citiesDestroyed: ["Transalvania"],
luckyNumbers: [61009, 33],
address: {
number: 61009,
street: "Transalvania Ave",
state: "KS",
zip: 61006
}
}

# 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
def initialize(name, super_power, age)
@name = name
@super_power = super_power
@age = age
@arch_nemesis = "The Syntax Error"
@power_level = 100
@energy_level = 50
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
def say_name
puts "#{@name}"
end

# - Create 2 instances of your SuperHero class
def maximize_energy
@energy_level = 1000
end

def gain_power(number)
@power_level + number
end

end
# - Create 2 instances of your SuperHero class
the_deep = SuperHero.new("The Deep", "has gills", 34)
black_noir = SuperHero.new("Black Noir", "super strength", 41)

puts the_deep.maximize_energy
p the_deep.gain_power(34)
puts the_deep.say_name
# Reflection
# What parts were most difficult about this exerise?

"The class portion, the dynamic vs static values really tripped me up.
I still have some confussion as to what initialize is doing."

# What parts felt most comfortable to you?

"following the directions and coding along."

# What skills do you need to continue to practice before starting Mod 1?

"Need to put in more reps so this all will become more intuitive."
7 changes: 4 additions & 3 deletions section1/exercises/booleans.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#-------------------

# EXAMPLE: log to the console the result of 1 is equal to 2:
p 1 === 2
p 1 == 2

# EXAMPLE: log to the console the result of 7 is greater than 2:
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
10 changes: 7 additions & 3 deletions section1/exercises/interpolation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@
name = "Ron"
team = "Chudley Cannons"

p "The #{team} are #{name}'s favorite Quidditch team"
puts "The #{team} are #{name}'s favorite Quidditch team"

# Write code that uses the variables below to form a string that reads
# "The quick red fox jumped over the lazy brown dog":
speedy = "quick red fox"
slow_poke = "lazy brown dog"

p # YOUR CODE HERE

puts "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

puts "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 = "Smog"
ability = "fire breathing"
charge_level = 100

puts "The dragon's name is #{name}, it has the ability #{ability}, It's ability is at #{charge_level} percent!"
10 changes: 8 additions & 2 deletions section1/exercises/loops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@

# Example: Write code that prints your name five times:
5.times do
p "Hermione Granger"
puts "Hermione Granger"
end

# Write code that prints the sum of 2 plus 2 seven times:
7.times do
# YOUR CODE HERE
puts 2 + 2
end

# Write code that prints the phrase 'She sells seashells down by the seashore'
# ten times:
# YOUR CODE HERE

10.times do
puts "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
puts 5 + 7
end
7 changes: 4 additions & 3 deletions section1/exercises/numbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
# `ruby section1/exercises/numbers.rb`

# Example: Write code that prints the result of the sum of 2 and 2:
p 2 + 2
puts 2 + 2

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

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

puts 6 * 53
# Write code that prints the result of the modulo of 10 into 54:
# YOUR CODE HERE
puts 10 % 54
9 changes: 5 additions & 4 deletions section1/exercises/strings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

# Example: Write code that prints your name to the terminal:
p "Alan Turing"

puts "Conor Barthel"
# Write code that prints `Welcome to Turing!` to the terminal:
p #YOUR CODE HERE

puts "Welcome to Turing!"
# 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.
puts "99 bottles of pop on the wall..."
# Write out code to log one line from your favorite song or movie.
puts "This isn't Nam Donnie there are rules!"
Loading