Programming Fundamentals Accelerated (3 CR)
PA1 - Feel the Burn!
Software Requirements Specification
Code due Wednesday, Sept 18, by 11:59pm - in WebCAT
Other subparts will have other deadlines
Introduction
Purpose: You have been asked by UREC to build an application to allow students to calculate the amount of calories that they burn during exercise. There are two formulas for this application one for women and one for men. For the first pass of the application, you will be calculating both...later on we will have the user indicate their gender to customize their application experience.
The Formulas (from FitNowTraining.com):
Men use the following formula:
Calories Burned = [(Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) -55.0969] x Time / 4.184.
Women use the following formula:
Calories Burned = [(Age x 0.074) + (Weight x 0.05741) + (Heart Rate x 0.4472) - 20.4022] x Time / 4.184.
Objectives - At the conclusion of this exercise the student will demonstrate that they can:
- Use predefined classes in a meaningful way.
- Divide a large problem up into small problems.
- Do everything necessary to create, debug, and run a Java program.
- Use methods in another class
- Use comments to delineate each section of the program.
- Adhere to a Style Guide.
- READ AND FOLLOW DIRECTIONS!!!!!
Deadlines
- Part A: See Canvas: September 12, no later than 11:59pm.
- Part B: See Canvas: September 15, no later than 11:59pm.
- Part C: WebCAT:September 18, no later than 11:59pm.
- Part D: See Canvas: September 20, no later than 11:59pm.
The Parts
Part A - Understanding the problem- See Canvas for detail
In this part of the assignment, you will demonstrate that you understand how the calculation is made and will consider how you might break this formula down to make it easier to work with. You will also demonstrate an understanding of the sequence of operations in a program based on these formulas. You will be building test cases to use in your testing process.
Part B - Writing the code - See the Part C module for the details about this section
You will be given a class that will help you with the computer solution. It will have helper methods that you can call upon to perform some of the tasks in the program. Your job will be to call upon these methods as needed based on your answers to Part B and to perform the necessary calculations and formatting of the resulting values. You will test your code using the test cases built in Part A and will submit your program to WebCAT. Your program must conform to all StyleGuide requirements for this class. 80% of the points for this part will come from correctly passing our reference tests and 20% will come from the conformance to style.
Part D - Reflecting on your work - See Canvas for detail
You will consider the process of building your program and think about ways of doing it better the next time. In this segment you will also need to answer a few questions about the program and techniques that you used.
Program Structure
You are a part of a team of programmers working on this application. One class has been written for you. It is called DukeFitIO.
You will write the class containing the main method. It must be called DukeFit.java
Program Behavior
- Your program must prompt the user for each of the 4 input values in the following order using the following prompts. A newline must be entered after each value is read in:
- Age (as an integer) - "Enter the person's age: "
- Weight (as a double) - "Enter the person's weight: "
- Heart rate (as an integer) - "Enter the person's heart rate: "
- Duration (as an integer) - "Enter the duration of the activity: "
- Your program must calculate the calories for both men and women.
- Your program must the output the values as follows:
- A blank line separating the input from the output.
- A line reading " Men: " followed on the same line by the Men's calories rounded to 2 decimal places.
- A line reading "Women: " followed on the same line by the Women's calories rounded to 2 decimal places.
- A single new line character must end the output.
You must be able to launch the application by calling the command java DukeFit from the command line.
NOTE: Be careful to read the documentation for DukeFitIO carefully as much of the detailed output work is being done for you.
Output and Error Handling
You do not need to be concerned about output or error handling as that has been done for you. You will find all output in DukeFitIO.
Additional Program Requirements
- Any additional methods that you add should be made private. (There is no need in this program to add methods.)
- Your program must conform to standard Java programming standards and the additional standards for this class. See the Style Guide for your class.
- You should, for your own benefit, write a tester that will test the various methods that you are building and the classes that you are using.
- You are NOT required to submit a tester program. All testing will be done by the instructor reference tests.
Honor Code
This work must conform to the JMU Honor Code and the specific requirements of this class. NO help may be provided by any student to another student. Authorized help is limited to your textbook, the TAs for any CS139, CS149, or CS159 section, and the professor for your section. Be sure to acknowledge any help that you do receive from a TA. See collaboration policy.
Grading
- Your program will be evaluated both on its correctness and conformance to the required Style elements.
- You will achieve a grade of 80 points for a program that runs correctly and produces exactly the required output in the required format on time.
- The remainding 20 points will be based on your conformance to the Style Guide and other requirements of the assignment. Review the Style Guide before submitting your program and the grade sheet which is produced by the submit system.
- All grades will be based on 100 points.
- You may submit any number of times. The only one I will count is the one that corresponds to the hardcopy report that you turn in.
- The hardcopy that you turn in will be the formatted version that I will check. Make sure it has no line wraps or other spacing issues.
- Successfully submitted programs that are late will be graded, then the late penalty is assessed for each day late according to the following schedule.
For submissions after the deadline, there will be a 10 point per day late penalty. Saturday will not count as a day. No submissions will be accepted after Tuesday September 24.
HINTS
- Be sure to understand what the IO class is doing for you. Do not duplicate anything that IO is doing.
- A model solution will be provided after the last late day.
Last updated: 09/10/2013