Ice01 Switch Statements

Note:  Please keep the programs that you create today, in case you have a question about your grades for the ICEs at the end of the quarter. When you're working with a partner, each person should save his-or-her own copy.

ICE ICE 16.2.1: Switch: Non-Robotic Code

Goal: Be able to write a switch statement that does not use Robots

Imagine that you're writing code to be used in a weight-lifting gym. The idea is that a person will do some number of repetitions of some exercise (for example, 12 bench presses), then type that number into your program, and receive feedback based on that.

Download the Nonrobot_Template.java file (newly commented throughout to throw in some hints about setting it up for use with a switch) to create a program that will repeatedly ask the user for the number of repetitions they've done.

Based on that number, you should offer feedback to the user according to the following chart (feel free to substitute your own, but don't offend the customer!)

Number of Reps Output
0 You need to start your workout!
1 That's it? You need to keep going!
2 Two? Two? You need to try harder!
3 Three is a start. Keep going!
4-6 Now you are warming up!
7-98 Nice job!
99 Quit. Program ends.

When you get done with this exercise, show your Instructor.