(Target-Heart-Rate Calculator) While exercising, you can use a heart-rate monitor to see that your heart rate...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(Target-Heart-Rate Calculator) While exercising, you can use a heart-rate monitor to see that your heart rate stays within a safe range suggested by your trainers and doctors. According to the Amer- ican Heart Association (AHA) (www.americanheart.org/presenter.jhtml?identifier=4736 ), the formula for calculating your maximum hear rate in beats per minute is 220 minus your age in years. Your target heart rate is a range that is 50-85% of your maximum heart rate. [Note: These formulas are estimates provided by the AHA. Maximum and target heart rates may vary based on the health, fitnes and gender of the individual. Always consult a physician or qualified health care profesional before beginning or modifying an exercise program.] Create a class called HeartRates. The class attributes should include the person's first name, last name and date of birth (consisting of separate attributes for the month, day and year of birth). Your class should have a constructor that receives this data as parameters. For each attribute provide set and get functions. The class also should include a function getAge that calculates and returns the person's age (in years), a function getMaxiumumHeartRate that calculates and returns the person's maximum heart rate and a function getTargetHeartRate that calculates and returns the person's target heart rate. Since you do not yet know how to obtain the current date from the comput- er, function getAge should prompt the user to enter the current month, day and year before calculating the person's age. Write an application that prompts for the person's information, instantiates an object of class HeartRates and prints the information from that object-including the person's first name, last name and date of birth-then calculates and prints the person's age in (years), maximum heart rate and target-heart-rate range. (Target-Heart-Rate Calculator) While exercising, you can use a heart-rate monitor to see that your heart rate stays within a safe range suggested by your trainers and doctors. According to the Amer- ican Heart Association (AHA) (www.americanheart.org/presenter.jhtml?identifier=4736 ), the formula for calculating your maximum hear rate in beats per minute is 220 minus your age in years. Your target heart rate is a range that is 50-85% of your maximum heart rate. [Note: These formulas are estimates provided by the AHA. Maximum and target heart rates may vary based on the health, fitnes and gender of the individual. Always consult a physician or qualified health care profesional before beginning or modifying an exercise program.] Create a class called HeartRates. The class attributes should include the person's first name, last name and date of birth (consisting of separate attributes for the month, day and year of birth). Your class should have a constructor that receives this data as parameters. For each attribute provide set and get functions. The class also should include a function getAge that calculates and returns the person's age (in years), a function getMaxiumumHeartRate that calculates and returns the person's maximum heart rate and a function getTargetHeartRate that calculates and returns the person's target heart rate. Since you do not yet know how to obtain the current date from the comput- er, function getAge should prompt the user to enter the current month, day and year before calculating the person's age. Write an application that prompts for the person's information, instantiates an object of class HeartRates and prints the information from that object-including the person's first name, last name and date of birth-then calculates and prints the person's age in (years), maximum heart rate and target-heart-rate range.
Expert Answer:
Answer rating: 100% (QA)
Code taking age of the user as input ageintinputEnter your age calculating maxi... View the full answer
Related Book For
Introduction to Probability and Statistics
ISBN: 978-1133103752
14th edition
Authors: William Mendenhall, Robert Beaver, Barbara Beaver
Posted Date:
Students also viewed these accounting questions
-
You can use a goodness-of-fit test to determine whether all of the criteria for a binomial experiment have actually been met in a given application. Suppose that an experiment consisting of four...
-
You can use a single radio receiver to find the distance to a transmitter by measuring the strength of the signal. Suppose these approximate distances are measured with a receiver while you drive...
-
a. Describe how you can use a coin to address the question Is it unlikely that the woman could get all eight correct if she were randomly guessing with each cup? Be sure to include details such as...
-
How does the trade-off between decision management and decision control affect the form that an absorption cost system takes within a particular firm?
-
John Goodtime is the accountant for the XYZ Business Services Company. His company provides basic accounting and tax services to about 100 small business clients in the Coral Gables area of Miami,...
-
The bicycle and rider have a mass of 80 kg with center of mass located at G. Determine the minimum coefficient of kinetic friction between the road and the wheels so that the rear wheel B starts to...
-
As in Problem 9.4, assume that the tube in Figure 9.8 is subjected only to an internal pressure and neglect the longitudinal stress. a. Determine the allowable internal pressure, \(p\), if the crack...
-
Golf Haven carries an inventory of putters and other golf clubs. Golf Haven uses the FIFO method and a perpetual inventory system. The sales price of each putter is $128. Company records indicate the...
-
The Conference Board Economic Forecast for the US Economy August 02, 2023 | Report The Conference Board forecasts that the growth seen in many parts of the economy will gradually buckle under...
-
1. Suppose Siscos altercation occurred while he was en route to his house during an unpaid one-hour lunch break. Would Sisco still be eligible for compensation? Why or why not? 2. Would Sisco have...
-
Net Income Problem There are two parts to each question. 1) Use the following information to compute values for each of the profitability measures listed below (show your work!). Note: you might want...
-
In November 2015, VW faced even more bad news. It was revealed that some three-liter, six-cylinder engines in cars produced by Audi, one of Volkswagen AGs luxury brands, also contained defeat...
-
Explain the strategic/consultative selling model in relation to selling in the global context.
-
Not surprisingly, an event with the size and scale of Milan Expo drew its share of criticism. For example, on April 30, the day before Expo opened, thousands of protesters took to the streets in...
-
Identify the forces that shape competition in an industry, and illustrate each force with a specific company or industry example.
-
How do support media complement the primary media in reinforcing their messages? Discuss the potential problems of support media.
-
A wide pipe divides into three narrower pipes. The wide pipe has a radius of 1 7 . 5 1 7 . 5 cm and transports water with an average velocity of 6 0 . 0 6 0 . 0 cm / / s . . Each of the narrow pipes...
-
What are some of the various ways to implement an awareness program?
-
According to a poll by the Pew Research Center, 55% of young adults (ages 18-29) believe that evolution is the best explanation for the development of human life.12 When the data are further...
-
A used-car dealership has found that the length of time before a major repair is required on the cars it sells is normally distributed with a mean equal to 10 months and a standard deviation of 3...
-
Compare the confidence intervals in Exercise 8.29. What effect does each of these actions have on the width of a confidence interval? a. Double the sample size b. Quadruple the sample size
-
How do you use functional requirements for this chapter?
-
How does deployment pattern help understand the core of the problem?
-
How do you apply nonfunctional requirements for this chapter?
Study smarter with the SolutionInn App