Program that calculates a persons Target Heart Rate.
Assignment Create a program that calculates a person's target heart rate (THR) and maximum heart rate (MHR) for aerobic exercise. According to the American Heart Association (AHA) the rates can be calculated as follows:
- MHR = 220 - age
- Minimum THR = MHR * 50%
- Maximum THR = MHR * 85%
- Note: Heart rates are in beats per minute (BPM) and age is in years.*
- Create a method that reads in the user's first name, last name, year of birth and the current year.
- Create a method that calculates and returns the user's age.
- Create a method that calculates and returns the user's MHR.
- Create a method that calculates and returns the minimum THR.
- Create a method that calculates and returns the maximum THR.
- Finally create a method that outputs the person's name, age, MHR and minimum and maxumum THR.