Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions final_prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 Ruby! 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 Ruby! 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?
Expand All @@ -19,37 +19,51 @@ 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`

![Week of 1:30](https://user-images.githubusercontent.com/93609855/145739595-b7fa1fa4-ac98-45b4-b83e-73525014f9d4.png)

- `Add Week 2 Screenshot Here`

![Week of 2:6](https://user-images.githubusercontent.com/93609855/145739612-8a8cc460-4021-4ae4-97d4-ead24d4806f6.png)

- `Add Week 3 Screenshot Here`

![Week of 2:13](https://user-images.githubusercontent.com/93609855/145739620-6200c348-c22f-4f28-882e-fde22c546b4c.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:

[Here is a link to my Mentorship Prep gist.](https://gist.github.com/James-Harkins/5753cdb437b022050991ec9e675146d3)

### 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:
- [X] Complete the [Pre Teaching Practice exercise](https://gist.github.com/ericweissman/0036e8fe272c02bd6d4bb14f42fd2f79) gist
- [X] Add a link to your gist here:

[Here is a link to my Lesson Prep gist.](https://gist.github.com/James-Harkins/dad5a2d7061db44ba08a547d469903d3)

### 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:
- [X] Complete the [DTR Guiding Questions](https://gist.github.com/ericweissman/c56f3a98cdce761808c21d498a52f5c6)
- [X] Add a link to your gist here:

[Here is a link to my Group Work Prep gist.](https://gist.github.com/James-Harkins/ec3e19a9cc257848d0e42da30c255f8b)

## 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
52 changes: 52 additions & 0 deletions final_prep/annotations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,37 @@

# Build a Bear

# Line 8 declares a method called "build_a_bear", which takes 5 arguments: name, age, fur, clothes, and special_power.
def build_a_bear(name, age, fur, clothes, special_power)

# Line 12 declares a variable within the build_a_bear method called "greeting", which contains a string that interpolates whatever value is passed as the argument for the
# name parameter.
greeting = "Hey partner! My name is #{name} - will you be my friend?!"

# Line 16 declares a variable within the build_a_bear method called "demographics", which contains an array containing the values passed as arguments for the name and
# age parameters.
demographics = [name, age]

# Line 20 declares a variable wthin the build_a_bear method called "power_saying", which contains a string that interpolates whatever value is passed as the argument for
# the special_power parameter.
power_saying = "Did you know that I can #{special_power}?"

# Lines 38-46 declare a variable within the build_a_bear method called "built_bear", which contains a hash containing 6 key/value pairs:

# 'basic info' is the key for the value "demographics", which is a previously declared variable containing an array containing the name and age of the bear, which are
# passed as arguments when the method is called.

# 'clothes' is the key for the value "clothes", which is simply the argument passed for the "clothes" parameter when the method is called.

# 'exterior' is the key for the value 'fur', which is simply the argument passed for the "fur" parameter when the method is called.

# 'cost' is the key for the float value "49.99".

# 'sayings' is the key for an array value containing the elements "greeting", which is a previously declared variable containing a string; "power_saying", which is
# another previously declared value containing a string; and the string, "Goodnight my friend!"

# 'is_cuddly' is the key for a boolean value of true.

built_bear = {
'basic_info' => demographics,
'clothes' => clothes,
Expand All @@ -18,25 +45,50 @@ def build_a_bear(name, age, fur, clothes, special_power)
}
end

# Lines 50 and 51 call the method "build_a_bear" and pass unique arguments for the required parameters.

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


# FizzBuzz

# Line 57 declares a method called "fizzubzz" with 3 parameters: num_1, num_2, and range.
def fizzbuzz(num_1, num_2, range)

# Line 61 sets up a for-loop that will run a conditional for every number in a range between 1 and the argument passed for the "range" parameter when the method is called.
# It also declares a variable "i" that will be declared each time we move onto the next number in the range, which will serve as its value.
(1..range).each do |i|

# Lines 65-66 set up the first condition: if it is true that the remainder of i and the argument passed for parameter "num_1" is zero, AND it is true that the remainder of
# i and the arguemnt passed for parameter "num_2" is zero, then the program will print "fizzbuzz" to the terminal.
if i % num_1 === 0 && i % num_2 === 0
puts 'fizzbuzz'

# Lines 70-71 set up the second condition, which will be checked if the first condition is not met: if the remainder of i and the argument passed for parameter "num_1" is
# zero, then the program will print "fizz" to the terminal.
elsif i % num_1 === 0
puts 'fizz'

# Lines 75-76 set up the third condition, which will be checked if neither the first nor second conditions are met: if the remainder of i and the argument passed for
# parameter "num_2" is zero, then the program will print "buzz" to the terminal.
elsif i % num_2 === 0
puts 'buzz'

# Lines 80-81 establish the consequent in the event that none of the three conditions is met: the program will print i, the current number in the range being checked against
# the conditions, to the terminal.
else
puts i

#Line 84 closes the conditional set up in line 65.
end

# Line 87 closes the for-loop set up in line 61.
end

# Line 90 closes the "fizzbuzz" method declared in line 57.
end

# Lines 93 and 94 call the "fizzbuzz" method, passing unique arguments.
fizzbuzz(3, 5, 100)
fizzbuzz(5, 8, 400)
110 changes: 106 additions & 4 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,95 @@

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

hero_name = "James"
special_ability = "Guitar Wizardry"

# 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 = "#{hero_name} says 'Ahoy!'"
cathphrase = "#{hero_name}'s catchphrase is '#{special_ability} strikes again!'"

# Declare two variables - power AND energy - set to integers

power = 100
energy = 100

# 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 = ["Kurt Cobain", "Eminem", "Billy Ray Cyrus"]
sidekicks = ["Eddie Van Halen", "Dimebag Darrell", "Uli Jon Roth"]

# Print the first sidekick to your terminal

p sidekicks.first

# Print the last arch_enemy to the terminal

p arch_enemies.last

# Write some code to add a new arch_enemy to the arch_enemies array

arch_enemies.push("Death Grips")

# Print the arch_enemies array to terminal to ensure you added a new arch_enemey

p 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

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

# 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
# - 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
puts "#{bad_excuse}"
elsif danger_level > 10
puts "#{save_the_day}"
else
puts "Meh. Hard pass."
end
end

#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)
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)
Expand All @@ -56,29 +99,88 @@
# - luckyNumbers (array)
# - address (hash with following key/values: number , street , state, zip)

scary_monster = {
'name' => "Frunobulax",
'smell' => "Sulfur",
'weight' => 800,
'citiesDestroyed' => ["Tacoma", "Los Angeles", "San Ber'Dino", "San Jose"],
'luckyNumbers' => [13, 66, 666],
'address' => {'number' => '59', 'street' => "Elm St.", 'state' => "CA", 'zip' => "90210"}
}

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

class SuperHero
attr_accessor :name, :super_power, :age

def arch_nemesis
"The Syntax Error"
end

def power_level
100
end

def energy_level
50
end

def initialize(name, super_power, age)
@name = name
@super_power = super_power
@age = age
p "This is #{name}, who's #{age} years old and whose super-power is #{super_power}."
p "#{name}'s arch nemesis is #{arch_nemesis}. #{name}'s power level is #{power_level} and energy level is #{energy_level}."
end

def say_name
p "This SuperHero's name is #{name}."
end

def maximize_energy
energy_level = 1000
p "#{name}'s energy level is now #{energy_level}!"
end

def gain_power(increase_value)
power_level = 50 + increase_value
p "#{name}'s power level is now #{power_level}!"
end

end

# - Create 2 instances of your SuperHero class

spider_man = SuperHero.new("Spider-Man", "Web Slingining", 18)
batman = SuperHero.new("Batman", "Immense Wealth", 35)

spider_man.maximize_energy
batman.gain_power(5000)

# Reflection
# What parts were most difficult about this exerise?

# The most difficult section of this exercise was the SuperHero class creation. I was unsure how to create static values, but after some googling,
# I discovered that I could set these up using instance methods.

# What parts felt most comfortable to you?

# Writing out the conditional in line 73 made perfect sense. I have a background in logic so following truth values is very intuitive for me.
# In general, everything feels fairly comfortable at this point.

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

# I need to practice creating classes and objects.
Loading