Proper coding conventions required the first letter of the class start with a capital letter

computer science

Description

The file must be called <LastInitialFirstInitialUnit6.java> (driver)

<LastInitialFirstInitialWorkout.java> (handles workout variables and methods)

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.

Only submit the .java files needed to make the program run. Do not submit the .class files or any other files.

Style Components

Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.

Basic Guidelines

You will be making a very basic workout tracker that will determine if you have exercised enough on a machine or done enough reps with weights.

LiFiUnit6.java

Provide a driver class that has the following items:

Creates an instance of the FiFiWorkout.java class.

Gets input for the first name.

Create a constant to hold the desired duration of a 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’ 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 an 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.

LiFiWorkout.java

Provide a workout class to hold instance variables as required by the driver.

Include accessor and mutator methods for each even if they aren’t required by the driver.

Sample output is provided below. Be sure to mimic it exactly except for values entered.

NOTE: Complete your activity and submit it by clicking “Submit Assignment”

Total Percentage

Sample

Below are 4 different inputs showing 4 different possible outputs. Your output will vary based on your Name, Machine, Duration, and Reps.


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.