Question
A health care issue that has been in the news lately is the computerization of health records. This possibility is being approached cautiously because of sensitive privacy and security concerns, among others. Computerizing health records could make it easier for patients to share their health profiles and histories among their various health care professionals. This could improve the quality of health care, help avoid drug conflicts and erroneous drug prescriptions, reduce costs and, in emergencies, could save lives. In this exercise, you’ll design a “starter” HealthProfile class for a person. The class attributes should include 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 inches) and weight (in pounds). Your class should have a constructor that receives this data. For each attribute, provide set and get methods. The class also should include methods that calculate and return the user’s age in years, maximum heart rate and target-heart-rate range, and body mass index. Write a Java application that prompts for the person’s information, instantiates an object of class HealthProfile for that person and prints the information from that object—including the person’s first name, last name, gender, date of birth, height and weight—then calculates and prints the person’s age in years, BMI, maximum heart rate and target-heart-rate range. It should also display the BMI values chart.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner(System.in);
HealthProfile hp = new HealthProfile();
// variables to get input
String string;
int number;
double aNumber;
// get user input
System.out.println("Enter your information here :");
System.out.print("First name : ");
string = input.next();
hp.setFirstName(string);
System.out.print("Last name : ");
string = input.next();
hp.setLastName(string);
System.out.print("Gender (male/female): ");
string = input.next();
hp.setGender(string);
System.out.println("Date : ");
System.out.print("\tDay (1-31): ");
number = input.nextInt();
hp.setDay(number);
System.out.print("\tMonth (1-12): ");
number = input.nextInt();
hp.setMonth(number);
System.out.print("\tYear : ");
number = input.nextInt();
hp.setYear(number);...
This is only a preview of the solution. Please use the purchase button to see the entire solution