JamesMadisonUniversity

Computer Science Department


CS 139 Lab:Health and Fitness Calculators - Part B


2 Creating HealthTester.java

  1. Create a file HealthTester.java either from the class template or your own.
  2. You need to prompt the user to supply their height (in whole inches), weight(in double pounds) and age(in whole numbers).
  3. You will then call the method calculateBMI which is in the Health class and has the following header:

    public static double calculateBMI(int height, double weight)

  4. Your application should then print a message indicating the applicable BMI value, formatted as a double with 1 decimal place.

  5. Next, your application should call the method, calculateTargetHeartRate which has the following header:

    public static int calculateTargetHeartRate(int age)

  6. It should then print out a message indicating that person's Target Exercise Heart Rate.

  7. Compile your application. The only errors you should have are those relating to methods of the Health class.

4 Save your file per your instructors requirement.


Updated 9/28/10 (nlh)