When getting into a fitness program, you may want to figure out your target heart rate so you don’t overexert yourself. The Karvonen heartrate formula is one method you can use to determine your rate. Create a program that prompts for your age and your resting heart rate. Use the Karvonen formula to determine the target heart rate based on a range of intensities from 55% to 95%. The formula is:
TargetHeartRate = (((220 − age) − restingHR) × intensity) + restingHR
• Don’t hard-code the percentages.
• Use a loop to increment the percentages from 55 to 95.
• Ensure that the heart rate and age are entered as numbers.
• Don’t allow the user to continue without entering valid inputs.
• Display the results in a tabular format.
• Generate a table with the results as shown in the example output below:
Resting Pulse: 65 Age: 22
55% 138 bpm
60% 145 bpm
65% 152 bpm
Must be written in JAVA