Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in java (CLO1; 16 Points) You are requested to design a class that keeps records of a person's health profile. Create a class named HealthRecord
in java
(CLO1; 16 Points) You are requested to design a class that keeps records of a person's health profile. Create a class named HealthRecord for a person. The class attributes should include: a. The person's first name, last name, gender, date of birth (consisting of separate attributes for the month, day and year of birth), height (in meters) and weight (in kilograms). b. Your class should have a constructor that receives the first three attributes (first name, last name, and gender). c. For each attribute, provide set and get methods. d. The class should include methods that calculate and return the user's age in years. e. The class also should include a method that calculates and returns the maximum heart rate. 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 American Heart Association (AHA), the formula for calculating the maximum heart rate in beats per minute is 220minusthe person's age in years. f. The class also should include a method that calculates and returns the target-heart-rate. The target heart rate of a person is 50% of his/her maximum heart rate. g. The class also should include a method that calculates and returns the body mass index. The body mass index is calculated as the weight of the person (in kilograms) divided by the square of the height (in meters). BMI=heightinMetersheightinMetersweightinKilograms h. (Bonus) Provide a method that passes the BMI value of the person and returns the category of which the person belongs. The BMI categories can be calculated as follows: Underweight if BMI value =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