Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- a survey company sampled @ Chegg Study I Guided Solut 3 14.6. Prog 6: Heart Rate During The Recent Snowinc | + O 1https:/
- a survey company sampled @ Chegg Study I Guided Solut 3 14.6. Prog 6: Heart Rate During The Recent Snowinc | + O 1https:/ ENGR204Garcia 18/chapter/14/section/6 For optimal aerobic benefit, a person should maintain a heart rate (heartRate) between 60% and 80% of his or her maximal heart rate, this range is called the aerobic target zone. heartRate = k"(maxHeartRate-restHeartRate) + restHeartRate where: restHeartRate is the person's rest heart rate maxHeartRate is a person's maximal heart rate calculated by maxHeartRate 220-age k is the percentage of maximal heart rate (0.06 for the lower rate, and 0.08 for the higher rate) Write a program to input a person's age and rest heart rate, then output the person's maximal heart rate and aerobic target zone In the main method, a loop is need to keep prompting the user to input age and rest heart rate until the user inputs negative number as either the age or rest heart rate. (2 points) The program MUST have the following four methods, in additional to the main method: (1) (2 points) A method named inputValue that prompts the user to input an integer (the main method will invoke this method twice to get age and rest heart rate), the header of the method should be public static int inputValue (Scanner (2) (2 points) A method named maxHR that returns the maximal heart rate, the header of the method should be public static int mexHR (int ) (3) (3 points) A method named targetZone that returns either the lower or higher end of the aerobic target zonee (rounded to the nearest Integer after the calculation), the header of the method should be public static int targetzone (double, int, int // the paraneter list is in the order of // k, reatHeartRate, maxHeartRate (4) (1 points) A method named printinfo that displays the maximal heart rate, the lower and higher ends of the aerobic target zone, the header of the method should be O Type here to search 10:58 AM 315/2018
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started