Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximilian Wagner #151

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
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
21 changes: 13 additions & 8 deletions final_prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Congrats on making it to the Mod 0 Final Prep! Complete the final exercises belo

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.
Expand All @@ -33,24 +33,29 @@ 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`
- ![53A68064-1AFB-46CA-8BE5-4E717F9B1565](https://user-images.githubusercontent.com/92329376/139558927-287d0565-6bf9-4415-ae37-9e5b76648e69.png)

- `Add Week 2 Screenshot Here`
- `Add Week 3 Screenshot Here`
- ![image](https://user-images.githubusercontent.com/92329376/139559051-ff8f0fbb-a8e2-4819-a909-3507d2e95dca.png)
-
- - `Add Week 3 Screenshot Here`
- ![image](https://user-images.githubusercontent.com/92329376/139559004-410491d8-b7b8-4d37-be46-71fc8dee487b.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/MWagner3/91240d8fa3e5a2ac91c8e6bbffabc4c5

### 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/MWagner3/38b53f9187f67dc83f98f09b54f1137a

### 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/MWagner3/f56b5c0752df1afd570ab45b1a8f8593
## 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 Expand Up @@ -86,4 +91,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!
30 changes: 26 additions & 4 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

# names the function and lists available arguments
MWagner3 marked this conversation as resolved.
Show resolved Hide resolved
def build_a_bear(name, age, fur, clothes, special_power)
#Assigns a greeting that interpolates the name argument
greeting = "Hey partner! My name is #{name} - will you be my friend?!"
#lists demographics as a variable and stores name and age in an array
demographics = [name, age]
#creates a saying in a string that interpolates special_power
power_saying = "Did you know that I can #{special_power}?"
#A hash listing characteristics about a built_bear
built_bear = {
#stores demographics inside basic_info
'basic_info' => demographics,
# stores clothes in clothes
'clothes' => clothes,
#assigns fur to the exterior value
'exterior' => fur,
#lists float cost and assigns it to the string cost
'cost' => 49.99,
#stores the greeting, power saying and and aditional string into sayings
'sayings' => [greeting, power_saying, "Goodnight my friend!"],
#defines boolean as true
'is_cuddly' => true,
#end hash
}
#
return built_bear
#end of function
end

#invokes the method we just created and assigns all of the required variables
build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares')
#invokes the method we just created and assigns all of the required variables
build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in')


# FizzBuzz

#creates method fizzbuzz and lists arguments (variables that we can change the value of)
def fizzbuzz(num_1, num_2, range)
#from 1-range number, take each number and...
(1..range).each do |i|
#if that number is divisible by num_1 AND num_2...
if i % num_1 === 0 && i % num_2 === 0
#puts fizzbuzz
puts 'fizzbuzz'
#if it is divisible by num_1...
elsif i % num_1 === 0
#puts fizz
puts 'fizz'
#if it is divisible by num_2...
elsif i % num_2 === 0
#puts buzz
puts 'buzz'
else
puts i
end
end
end

#invokes the fizzbuzz method with sets of appropiate arguments(variables)
fizzbuzz(3, 5, 100)
fizzbuzz(5, 8, 400)
fizzbuzz(5, 8, 400)
94 changes: 89 additions & 5 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,68 @@

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

hero_name = "Doug the Pug"
special_ability = "bark"
# 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 citizens! It is I, #{hero_name}!"
catchphrase = "Get #{special_ability}ed, you fiend!"

# 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 = false
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 = ["Brett the vet", "Stan the mailman", "Nat the cat"]
sidekicks = ["Klaus the mouse", "Wendy the friendly" "Molly the Collie"]

# Print the first sidekick to your terminal

puts sidekicks[0]

# Print the last arch_enemy to the terminal

puts arch_enemies.last

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

arch_enemies << "Billy the Butcher"

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

puts arch_enemies

# Remove the first sidekick from the sidekicks array

sidekicks.shift #or
sidekicks.delete_at(0)


# 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

# Your function should include an if/else statement that meets the following criteria
Expand All @@ -48,6 +78,17 @@
#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."

def assess_situation(danger_level, save_the_day = "bark bark bark", bad_excuse = "Sorry, I left my car running")
if danger_level > 50
puts bad_excuse
elsif danger_level >= 10 and danger_level< 50
puts save_the_day
else
puts "Meh. hard pass"
end
end


# Declare a new variable - scary_monster - assigned to an hash with the following key/values
# - name (string)
# - smell (string)
Expand All @@ -56,16 +97,25 @@
# - luckyNumbers (array)
# - address (hash with following key/values: number , street , state, zip)

scary_monster = {
"name" => "Godzilla",
"smell" => "fishy",
"weight" => 9999,
"citiesDestroyed" => ["Tokyo", "Osaka"],
"luckyNumbers" => [9, 1],
"address" => {"number" => 999, "street" => "Abomination Rd", "state" => "VA", "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"
# - 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
Expand All @@ -74,11 +124,45 @@

# - Create 2 instances of your SuperHero class

class SuperHero
attr_reader :name, :super_power, :age, :arch_nemesis, :power_level, :energy_level

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

def say_name
puts name
end

def maximize_energy
@energy_level = 1000
end

def gain_power(number)
puts energy_level + (number)
end

end

batman = Superhero.new("Batman", "Wealth", 45)
spiderman = Superhero.new("Spiderman", "web-shooting", 18)


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

"I had forgotten some method syntax for the danger level exercise. I had to go back and re-learn that section."

# What parts felt most comfortable to you?

"I had just finished the class exercises previously to doing this, so that section was the most fresh."

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

"I did not have time to complete all of the study drills, so I will use them as review between now and Mod 1 start."
7 changes: 7 additions & 0 deletions section1/ex1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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.'
9 changes: 9 additions & 0 deletions section1/ex2.rb
Original file line number Diff line number Diff line change
@@ -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 "dissable" or comment out a piece of code:
# puts "This won't run."

puts "This will run."
23 changes: 23 additions & 0 deletions section1/ex3.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
puts "I will now count my chickens:"

puts "Hens #{25 + 30 / 6}"
puts "Roosters #{100 - 25 * 3 % 4}"

puts "Now I will count the eggs:"

puts 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6

puts "Is it true that 3 + 2 < 5 - 7?"

puts 3 + 2 < 5 - 7

puts "What is 3 + 2 #{3 + 2}"
puts "What is 5 - 7 #{5 - 7}"

puts "Oh, thats why it's false."

puts "How about some more."

puts "Is it greater #{5 > -2}"
puts "Is it greater or equal? #{5 >= -2}"
puts "Is it less or equal? #{5 <= -2}"
16 changes: 16 additions & 0 deletions section1/ex4.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cars = 100
spaces_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * spaces_in_a_car
average_passengers_per_car = passengers / cars_driven


puts "There are #{cars} cars available."
puts "There are only #{drivers} available."
puts "There will be #{cars_not_driven} empty cars today."
puts "We can transport #{carpool_capacity} people today."
puts "We have #{passengers} to carpool today."
puts "We need to put about #{average_passengers_per_car} in each car."
17 changes: 17 additions & 0 deletions section1/ex5.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
my_name = 'Zed A. Shaw'
my_age = 35 # not a lie in 2009
my_height = 74 #inches
my_weight = 180 # lbs
my_eyes = "Blue"
my_teeth = "White"
my_hair = "Brown"

puts "Let's talk about #{my_name}."
puts "He's #{my_height} inches tall."
puts "He's #{my_weight} pounds heavy."
puts "Actually that's not too heavy."
puts "He's got #{my_eyes} eyes and #{my_hair} hair."
puts "His teeth are usually #{my_teeth} depending on the coffee."

# this line is tricky, try to get it exactly right
puts "If I add #{my_age}, #{my_height}, and #{my_weight} I get #{my_age + my_height + my_weight}."
21 changes: 21 additions & 0 deletions section1/ex6.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
types_of_people = 10
x = "There are #{types_of_people} types of people."
binary = "binary"
do_not = "don't"
y = "Those who know #{binary} and those who #{do_not}."

puts x
puts y

puts "I said: #{x}."
puts "I also said: #{y}."

hilarious = false
joke_evaluation = "Isn't that joke so funny?! #{hilarious}"

puts joke_evaluation

w = "This is the left side of..."
e = "a string with a right side."

puts w + e
8 changes: 8 additions & 0 deletions section1/ex7.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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."
Loading