Programming Fundamentals Accelerated (3 CR)

swimmer PA2 - Feel the Burn, Part 2!

Software Requirements Specification

Code due Wednesday, Oct 2, by 11:59pm - in WebCAT

Other subparts will have other deadlines

UPDATE: 09/27/2013 - The nature of testing of DukeFitIO makes it difficult for you at this point to be able to write your own tests. I have provided a test file which you can use for testing, but you should also submit it to WebCAT as part of your zipped package. You will need to submit both DukeFit and DukeFitIO along with the test I provide and your own test for DukeFit.

Introduction

Purpose: You have written DukeFit, but now have some new tools and techniques. Also, your organization has decided that the old DukeFitIO class needs to be rewritten. You have been assigned the task of "refactoring" this application.

The Formulas (This has not changed) (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 can test a method in isolation and develop test cases.

Part B - Writing the code - See the Part B module for the details about this section

You will be rewriting your code from PA1 and writing the code that was given to you in PA2. You will test your code using the test cases built in Part A and will submit your program to WebCAT along with those test cases. . 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 C - 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. You are maintaining two programs. One is called DukeFitIO and will be rewritten from scratch.

You will rewrite the class containing the main method. It must be called DukeFit.java.

Specific structure (Your program must conform to these method signatures). You may add additional private methods should you choose to do so. Recall from the Style Guide that no method may be longer than 25 statements. (This excludes white space and comments.) Each method must address the requirements listed below.

DukeFitIO

All methods must be non-static.

DukeFit

Application Behavior

  1. Your application must prompt the user for each of the 4 input values in the following order using the following prompts. (NOTE: The last version also required a new line character following the read, but that should not be done in this version. Simply output the prompt and read the corresponding value.)
    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 each line of output.

You must be able to launch the application by calling the command java DukeFit from the command line.

Output and Error Handling

You do not need to be concerned about Error Handling and should assume that only valid values are entered for each of the prompts.

Testing

Based on the lab from Monday Sept 23, you must build a test suite that will exercise your program. Use this file for DukeFitIOTest.java. DukeFitIO.java It will run each of the methods in DukeFitIO.java, but will not test any results. This file will enable you to pass "coverage" tests in WebCAT.

For DukeFit, you should build a tester DukeFitTest.java. You should test your calculateMen and calculateWomen method passing at least 3 different values. If you create a format method, you must also test it. Your program will be assessed both by the completeness of coverage of your code (all lines should be executed) and by your conformance to the reference tests that the instructor provides.

Additional Application 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 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 October 15.

 

Last updated: 09/23/2013