LiFiUnit6.java
Provide a driver class that has the following items:
- Creates an instance of the FiFiWorkout.java class.
- Gets input for first name.
- Create a constant to hold the desired duration of workout. Set it to 30.
- Create a constant to hold the desired number of reps. Set it to 20.
- Use a looping structure to get input until either "M' or 'W' are entered. Accept M or m and W or w. Use the string class to convert it to upper case.
- Use a switch structure to work with either the 'M' or 'W'.
- If M or Machine is selected:
- Get input for the machine name such as "elliptical" or "treadmill".
- Get the duration in minutes of the workout performed.
- If W or Weights is selected:
- Get input for the weight in integer.
- Get input for the number of reps performed.
- After the input has been accepted above:
- If the workout duration or reps are equal to or above the desired, then output "Good Job" as shown in the sample, including the duration, reps, machine, desired duration, or desired reps. See sample for exact output.
|
60%
|