Programming Fundamentals Accelerated (3 CR)

swimmer 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:

Deadlines

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

  1. 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:
    1. Age (as an integer) - "Enter the person's age: "
    2. Weight (as a double) - "Enter the person's weight: "
    3. Heart rate (as an integer) - "Enter the person's heart rate: "
    4. Duration (as an integer) - "Enter the duration of the activity: "
  2. Your program must calculate the calories for both men and women.
  3. Your program must the output the values as follows:
    1. A blank line separating the input from the output.
    2. A line reading "   Men: " followed on the same line by the Men's calories rounded to 2 decimal places.
    3. A line reading "Women: " followed on the same line by the Women's calories rounded to 2 decimal places.
    4. 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

  1. Any additional methods that you add should be made private. (There is no need in this program to add methods.)
  2. Your program must conform to standard Java programming standards and the additional standards for this class. See the Style Guide for your class.
  3. 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.
  4. 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

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.

 

Last updated: 09/10/2013