Scenario:

Since it is Summer time and you want to get healthy, you have made a commitment to exercise and want to track all of the workouts you perform in one week. To avoid stressing yourself too quickly, youve decided to limit yourself to no more than 6 workouts in one week and no more than one workout per day. You will create an application to track all of the workouts youve completed. The application needs to be able to add a workout and print workout information

Each workout will either be aerobic or anaerobic, but never both. For all workouts, you must track the day of the week (Monday through Sunday), amount of time spent working out (in hours, greater than 0 up to and including 3), and level of exertion (whole numbers on a scale of 1 to 10, inclusive). For anaerobic workouts, you must also track a list of all exercises completed (e.g. pushups, pullups, etc.), up to 10 exercises. Additionally, for anaerobic workouts, at least one exercise must be completed.

To calculate the number of calories burned in an aerobic workout, multiply the number of hours spent working out by the number of calories burned per hour for the aerobic workout (a number between 0 and 1000, inclusive). To calculate the number of calories burned in an anaerobic workout, multiply the number of exercises completed by 15.

A workout report should be well-formatted with a report header, listing the type of workout (aerobic or anaerobic), day of the week, amount of time spent working out, level of exertion, and number of calories burned for each workout. For aerobic workouts, the report should also include the number of calories burned per hour. For anaerobic workouts, the report should also include a list of the exercises completed. Lastly, the report should include the total number of workouts completed and the total number of calories burned across all workouts.

Create an efficient, object-oriented solution, using good design principles, with a polished user interface that will allow you to continue to enter workouts, according to the requirements specified, until you have entered the maximum number of workouts permitted, or you have indicated you are finished entering workouts, whichever comes first. For each workout entered, you should be allowed to select the type of workout you wish to enter and enter in all information about the workout.

Once all workout information has been entered, print a well-formatted report summarizing your workouts for the week.

Notes:

  • Pay very careful attention to the logic requirements of the scenario. Make sure your solution meets each requirement.
  • Think about what type of validations might be appropriate for this application. Make sure these are all handled. Dont forget about what you learned about data validation in IT 106 (e.g. if statements, try/catch, etc.). Whenever an invalid value is entered, the user must be informed and re-prompted.

Other Requirements:

  • Your solution must incorporate one or more arrays. ArrayLists may not be used.
  • Your solution must demonstrate use of abstract classes/methods, inheritance and polymorphism.
  • You may not use Scanner or System classes for input/output. You must use JOptionPane.
  • You may not use System.exit, or any variant that exits the program in the middle of the program. The program should only exit once the algorithm has finished completing.
  • Your solution may not use any functions or language constructs not covered during IT 106 or this semesters IT 206 without prior authorization from your instructor, even if you know other functions or language constructs. We want everyone to be on the same "playing field", regardless of previous programming exposure, and get practice with algorithmic design to solve problems (the intent of the course). Using something existing not discussed in class does not give you as much practice as solving the problem yourself. Doing this may lead to a substantial grade penalty, a grade of zero, or an Honor Code inquiry. When in doubt, ask!

To Do

Programming Assignment 7: Solution Design

  • List and describe the purpose of each class that will be needed to solve this problem
    • You must separately identify (list) and describe the purpose of each class. One or two sentences per class should be sufficient.
  • Create a detailed UML class diagram, listing and explaining all class variables, accessors, mutators, special purpose methods, and constructors associated to each data definition class
  • Create a defining diagram/IPO hierarchy chart detailing the implementation design (Note: You must do this, but it is not required to be submitted)
  • Create pseudocode detailing your solution design
    • Data Definition Class(es) You must provide pseudocode ONLY for validating mutators and special purpose methods. No pseudocode is necessary for constructors or accessors
    • Implementation Class You must provide pseudocode for all methods

Programming Assignment 8: Solution Implementation

Write a well-documented, efficient Java program that implements the solution design you identified. Include appropriate documentation as identified in the documentation expectations document.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.