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

Adrian Campos #152

Open
wants to merge 7 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
40 changes: 22 additions & 18 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 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?
Expand All @@ -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.
Expand Down Expand Up @@ -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!
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!
42 changes: 35 additions & 7 deletions final_prep/annotations.rb
Original file line number Diff line number Diff line change
@@ -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)

# 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)
101 changes: 95 additions & 6 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,88 @@

# 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
# - 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
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.'
Expand All @@ -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
Expand All @@ -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.
8 changes: 8 additions & 0 deletions section1/ex1.rb
Original file line number Diff line number Diff line change
@@ -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!"
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 "disable" or comment out a piece of code:
# puts "This wont run."

puts "This will run."
37 changes: 37 additions & 0 deletions section1/ex3.rb
Original file line number Diff line number Diff line change
@@ -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}"
Loading