Skip to content

Latest commit

 

History

History
57 lines (48 loc) · 4.42 KB

readme.md

File metadata and controls

57 lines (48 loc) · 4.42 KB

JumpStart Live (JSL)

Day 2

Prep Work

Goals

  • Understand order of operations
  • Understand and be able to use relational and logical operators
  • Understand and be able to write boolean expressions
  • Understand and be able to write conditional statements

Warm up

  • Share what you learned from our last session about coding style
  • Walk your partner though your Candy machine code focusing on using programming vocabulary (e.g, conditional statements, variable assignment, relational operators, logical operators, expressions)

Lessons

Exercises

In one Ruby file, write code to solve the problems below. Your code should print out each problem statement, followed by the output from the conditional statement(s).

  1. Prompt for a number. If the number is greater than 70, print PASSING; otherwise, print NOT PASSING.
  2. Prompt for a string. If the string is equal to green, print GO, otherwise, print STOP.
  3. Prompt for a number. If the number is even, print EVEN, otherwise, print ODD.
  4. Prompt for a number. If the number is evenly divisible by 5, print MULTIPLE OF 5, otherwise, print NOT A MULTIPLE OF 5.
  5. Prompt for a number. If the number is less than 10, print ONE DIGIT. If the number is 100 or greater, print THREE DIGITS, otherwise print TWO DIGITS.
  6. Prompt for a jersey number. If that number is 12, 71, or 80, print That number is retired from the Seattle Seahawks!, otherwise do nothing.
  7. Prompt for a state. If the state is Washington, Oregon, or Idaho, print This state is in the PNW, otherwise print You should move to the PNW; it’s great here!
  8. Prompt for a one of the following: SHORT, TALL, GRANDE, VENTI. Print out the number of ounces that drink includes (8, 12, 16, 20 respectively).
  9. Prompt for rate of pay and hours worked. Calculate gross pay. Provide time-and-a-half for hours worked beyond 40 (e.g., if you get paid $10/hr and work 45 hours in a week, you would gross $475 (40 x 10 + 5 x 15).
  10. Rewrite the solution to the previous problem adding this modification: do not process any employee if their hours worked is greater than 60, instead display the message Please see manager.

Debrief

  • What new things did you learn today?
  • What topics are you still struggling with?
  • What did you especially enjoy about today's class?
  • What can be improved for future classes?

Resources

Homework

  • Revise your code for exercises for the day based on discussions in class, then share the gist with the instructors
  • Review your Election time solution and be prepared to talk with others about your code
  • Review the Iterator notes from JumpStart
  • Watch Day 3 Videos (~33 minutes)
  • Review lesson notes for Day 3
  • Complete the Day 3 exercises and be prepared to discuss them with others in class