JumpStart Live (JSL)
- Review your Candy Machine solution and be prepared to talk with others about your code.
- Review the Conditional and operators notes from JumpStart.
- Watch Day 2 Videos (~45 minutes).
- Review lesson notes for Day 2.
- Complete the exercises and be prepared to discuss them with others in class.
- 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
- 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)
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).
- Prompt for a number. If the number is greater than
70
, printPASSING
; otherwise, printNOT PASSING
. - Prompt for a string. If the string is equal to
green
, printGO
, otherwise, printSTOP
. - Prompt for a number. If the number is even, print
EVEN
, otherwise, printODD
. - Prompt for a number. If the number is evenly divisible by
5
, printMULTIPLE OF 5
, otherwise, printNOT A MULTIPLE OF 5
. - Prompt for a number. If the number is less than
10
, printONE DIGIT
. If the number is100
or greater, printTHREE DIGITS
, otherwise printTWO DIGITS
. - Prompt for a jersey number. If that number is
12
,71
, or80
, printThat number is retired from the Seattle Seahawks!
, otherwise do nothing. - Prompt for a state. If the state is
Washington
,Oregon
, orIdaho
, printThis state is in the PNW
, otherwise printYou should move to the PNW; it’s great here!
- 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). - 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
). - 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 messagePlease see manager
.
- 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?
- Day 2 Videos
- Conditional notes from JumpStart
- Operators notes from JumpStart
- Revise your code for exercises for the day based on discussions in class. Share the gist with the instructor(s).
- 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.