Object Oriented Programming (JAVA) Assignment

Summary

This document outlines the requirements for a Java programming assignment on object-oriented programming and fitness tracking. Students are tasked with creating a program using FitnessTracker.java, generating a UML class diagram, and performing JUnit testing as well as Javadoc commenting. The project involves calculating metrics such as distance walked, weekly active minutes, fitness level, and daily calorie deficit.

Full Transcript

Object Oriented Programming (JAVA) CST 8284 Assignment 1 Instructions This assignment is designed to be completed and submitted by you individually. It is your responsibility to ensure that your work is NOT replicated by any other s...

Object Oriented Programming (JAVA) CST 8284 Assignment 1 Instructions This assignment is designed to be completed and submitted by you individually. It is your responsibility to ensure that your work is NOT replicated by any other student, and that you do not copy or submit someone else’s work. Avoid plagiarism. The due date for submission of this assignment is Sunday, February 16 by 11:59PM. You can demo this assignment in Week 6 or Week 7. The final date to demo this assignment is in Week #7 (whichever day your ab session falls into that week). If you choose to demo in week 6, you must submit your work first before the demo session. Note that you cannot resubmit your work after your demo. Carefully read every instruction and the tasks to ensure that you deliver all aspects of your solution as required. This assignment when completed fully and correctly weighs 10% of the entire course marks. Ask for clarification if needed. Background Information Fitness tracking applications are widely used to monitor physical activities and promote healthier lifestyles. These applications collect user data such as daily steps, calories burned, and active minutes, enabling users to track their progress and set fitness goals. Your task is to create a program that captures user fitness data and calculates key metrics to evaluate fitness levels. Ensure that you completely review the starter code file provided for you in order to understand what they contain and the modification you are required to make. COMPONENT 1 1. Download, review and modify the java class file provided to you named FitnessTracker.java. 2. Take time to study the background scenario and create a UML class diagram that captures all the attributes, methods, etc., which are required in your solution. 3. The attributes of FitnessTracker.java should include the following patient’s data: a. First name b. Last name c. Gender d. Steps taken (daily) e. Calories burned (daily) f. Active minutes (daily) g. Hint 1: Ensure that the UML class diagram that you created includes all other attributes that have been listed in the class. 4. The class (FitnessTracker) should have a constructor that receives these data as parameters to initialize all attributes. 5. For each attribute mentioned in (3) above, you should provide the appropriate set and get methods. 6. The class must provide methods to calculate and return the values for the following: a. Calculate distance walked in meters based on steps (assume a step length of 0.8 meters for males and 0.7 meters for females). b. Calculate weekly average active minutes. c. Determine fitness level with more detailed criteria based on weekly activity and calories burned: i. Active: More than 150 active minutes per week and over 2000 calories burned. ii. Moderately Active: Between 75-150 active minutes per week or 1000-2000 calories burned. iii. Sedentary: Less than 75 active minutes per week and under 1000 calories burned. d. Calculate daily calorie deficit or surplus based on a user-specified maintenance calorie level. 7. Write a Test class for your code named FitnessTrackerTest.java. a. This code must prompt for input of the patient’s data (described above). b. Instantiate an object of the class FitnessTracker. c. Display all the user’s details above and calculated metrics, including: i. Distance walked ii. Weekly average active minutes iii. Fitness level iv. Daily calorie deficit or surplus 8. Execute your code and include your output file. Your output file must be an eclipse screen shot only. Any other form of representation of your output in this assignment will NOT be accepted. Be sure to capture all the portions of the eclipse screen which must include your output, header and a portion of your code. Place all screen shots in a MS Word document (no PDF) for your submission. 9. Use the Javadoc style comments to insert comments in appropriate places in your code to explain your work. You are required to write, generate and submit the Javadoc files. 10. Zip all your files (containing your java code files, UML Diagram, screen shots and the generated Javadoc file) and submit in your lab section (designated portal by your lab professor). While naming your file for submission, use the naming format (use this format to avoid losing marks): Lab_Section_XXX_YourFirstName_YourLastName. COMPONENT 2 JUnit Testing: 1. Create a JUnit test for FitnessTracker and name it FitnessTrackerTest2 to test the testCalculateDistance(), calculateDistance() and calculateCalorieDeficit() methods. Write your test case using the suitable assertions. You must NOT use the same assertions for all your tests. Testing Output: Include two test scenarios: i. Successful execution with no errors (show the green bar). ii. Failed execution by introducing an error (show the red bar). Documentation: Use Javadoc comments to document the test cases and describe any assumptions or modifications made. These assumptions and/or modifications must be stated at the beginning of your Test file (FitnessTrackerTest2). Submission Requirements: Submit a zipped folder containing: o All Java code files o Screenshots of outputs o UML diagram o Javadoc files Assignment Rubrics (10%) If your code does not have a header which identifies the writer of the code (name and other personal details), your assignment will be graded 0. File submission and output – generate and submit correct output files (0.1%) Attributes: include correct and complete declaration (0.5%) Constructor: specify constructor(s) within your solution as required in FitnessTracker (0.4%) set and get methods: include correct and complete setters and getters as required (1.0%) Calculate and return correctly: formulate and apply calculations as listed in item 6 above. (2.5%) Complete and correct implementation of all aspects of your solution as required (user input, instantiate an object, printing required data from the object, etc. (1.5%) Create and submit complete and correct UML diagram – (1%) Include Javadoc comments in the right places within the code. Correctly generate and submit the Javadoc files for Component 1 (1%) JUnit test (with the correct assertions including assumptions made) – (1%) Screenshot of Eclipse output showing the successful execution of the test – (0.25%) Screenshot of Eclipse output showing the failed execution of the test – (0.25%) Include Javadoc comments in the right places within the code. Correctly generate and submit the Javadoc files for Component 2 (0.5%) Sample Outputs

Use Quizgecko on...
Browser
Browser