Skip to content

Latest commit

 

History

History

day6

JumpStart Live (JSL)

Day 6

Prep Work

Warm up

  • Share what you learned from our last session on arrays
  • Walk your partner though your Student Account Generator Part 2 code focusing on using programming vocabulary (e.g, hashes, key, value, blocks, loops, iterator, variable assignment)

Lessons

Exercise

  1. Ask the user to enter the names, ages, and favorite colors of their closest friends (you may not assume that the user's close friends all have unique names). Output the total number of close friends under 18, followed by their names. Output the number of unique favorite colors, and then list them (Hint: Check out the uniq method of the Array class in Ruby). Your solution should use at least 1 hash and at least 1 array.

Sample Log

Welcome to Hash Fun.
I will be asking you for the names, ages, and favorite colors of your closest friends.
How many close friends do you have? 2
What is friend #1s name? Riley
What is friend #1s age? 37
What is friend #1s favorite color? Gray
What is friend #2s name? Amanze
What is friend #2s age? 16
What is friend #2s favorite color? Blue

You have 1 close friend under 18 [Amanze].
Your friends have 2 unique favorite colors [Gray, Blue].

Debrief

  • How do you determine whether it is best to use an array or a hash?
  • How can we further support you before the first day of Ada class?
  • What did you especially enjoy about JumpStart Live?
  • What can be improved for future offerings of JumpStart Live?

Resources

Homework

  • Revise your code for exercises for the day based on discussions in class, then share the gist with the instructors
  • Reattempt the code challenge your submitted during the admission process leveraging loops, arrays and hashes, then share the gist with the instructors
  • Relax, and enjoy your week before the start of Ada
  • Complete the optional assessment, if desired