Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve the error i have there...... by java launguge ipse Window Help O h heathRecordjava 1 package heathRecord; 2 import java.util.Scanner; 3 public class heathRecord

solve the error i have there...... by java launguge image text in transcribed
image text in transcribed
image text in transcribed
ipse Window Help O h heathRecordjava 1 package heathRecord; 2 import java.util.Scanner; 3 public class heathRecord public static void main(Stringll args) // TODO Auto-generated method stub String firstName, lastName; int day, month, year float weight, height: Scanner input = new Scanner(System.in); System.out.print("Enter your first name: "); firstName input.nextLine(); System.out.print("Enter your last name:" ); lastName=input.nextLine(); System.out.println("Enter your Date of birth:"): System.out.print("\tDay: "); day input.nextInt (); System.out.print("\tMonth: ") month input.nextInt (); System.out.print("\tYear"); year-input.nextInt (); System.out.print("Enter your height in meter:"); height=input.next Float(); System.out.print("Enter your weight in kg:"); Weight=input, nextFloat () healthRecord ob- new health Record (first Name, lastNa year, height, weight); String BMI"" float bmi - obj.computeBMI(); if (mi-18.566 bmi=25&6 bmi 29.9) EMI-"Overweight": else if (bmi>=30) BMI="Obese"; 2. Problems Javadoc Declaration Consoles terminated heathRecord lava Application C\Program Files (x86)\Java 1.8.0 241 binjavaw.exe (Feb 5, 2020.938:16 AM Exception in thread "main" java.lang. Error: Unresolved compilation problema: oby cannot be resolved ob cannot be resolved obcannot be resolved at heathRecord.heathRecord.main (heathRecord.java:34) Witable Smart Insert 21.38 Record.java System.out.print("Enter your first name: "); firstName input.nextLine(); System.out.print("Enter your last name:" ); lastName=input.nextLine(); System.out.println("Enter your Date of birth:"); System.out.print("\tDay:"); day-input.nextInt(); System.out.print("\tMonth: "); month=input.nextInt(); System.out.print("\tYear"); year-input.nextInt(); System.out.print("Enter your height in meter:"); height=input.nextFloat(); System.out.print("Enter your weight in kg:"); weight-input.nextFloat(); healthRecord obj = new healthRecord (firstName, lastName, month, day, year, height, weight); String BMI-""; float bmi = obj.computeBMI(); if (bmi=18.5&& bmi=25&& bmi30) BMI-"Obese"; System.out.println(" "+firstName+"age is" + obj.computeAge()); System.out.println("Your maximum heart rate is" obj.computeAge () ); System.out.printf("Your BMI is 1.21"+"..>" +BMI ,bmi); Problems Javadoc Declaration Console 1 erminated heath Record Lava Application Program Files (x86)\lavalie1.0 241\bin javaw.exe (Feb 5, 2020.938:16 AM aception in thread "main" java.lang.Error: Unresolved compilation problems: obj cannot be resolved obj cannot be resolved obj cannot be resolved at heathRecord.heathRecord.main (heathRecord.java:34) Q1. Create a health Record class for a person. The class should have the following attributes: first name last name date of birth consisting of separate instance variable for cach of month, day and year of birth) height (in m) weight (in kg) Your class should have a constructor that receives all the above attributes. For each attribute, provide set and get methods. The class also should include methods that: 1. computeAge : calculate and return the user's age in years to compute age use: 2020 minus year of birth) 2. compute MHR: calculate and return the maximum heart rate. According to the American Heart Association (AHA) (www.americanheart.org presenter.jhtml?identifier 4736), the formula for calculating your maximum heart rate in beats per minute is 220 minus your age in years 3. computeB MI: calculate and return the user's body mass index (BMI). The formula for calculating BMI is Write a festDrive class which includes your main function. In your main function: 1. Ask the user to enter his/her information as shown in the sample output below 2. Calculate and print the user's maximum heart rate 3. Calculate and print the user's BMI 4. Print the BMI category according to the following rule: BMI VALUES Underweight: less than 18.5 Normal: between 18.5 and 24.9 Overweight: between 25 and 29.9 Obese: 30 or greater Sample output (green color represents user's input): Enter your first name: Manar Enter your last name: Khalid Enter your date of birth: Day: 1 Month: 1 Year: 2000 Enter your height in meter: 1.46 Enter your weight in kg: 56 Manar's age is 19 Your maximum heart rate is 201 Your BMI is 26.27 --> Overweight ipse Window Help O h heathRecordjava 1 package heathRecord; 2 import java.util.Scanner; 3 public class heathRecord public static void main(Stringll args) // TODO Auto-generated method stub String firstName, lastName; int day, month, year float weight, height: Scanner input = new Scanner(System.in); System.out.print("Enter your first name: "); firstName input.nextLine(); System.out.print("Enter your last name:" ); lastName=input.nextLine(); System.out.println("Enter your Date of birth:"): System.out.print("\tDay: "); day input.nextInt (); System.out.print("\tMonth: ") month input.nextInt (); System.out.print("\tYear"); year-input.nextInt (); System.out.print("Enter your height in meter:"); height=input.next Float(); System.out.print("Enter your weight in kg:"); Weight=input, nextFloat () healthRecord ob- new health Record (first Name, lastNa year, height, weight); String BMI"" float bmi - obj.computeBMI(); if (mi-18.566 bmi=25&6 bmi 29.9) EMI-"Overweight": else if (bmi>=30) BMI="Obese"; 2. Problems Javadoc Declaration Consoles terminated heathRecord lava Application C\Program Files (x86)\Java 1.8.0 241 binjavaw.exe (Feb 5, 2020.938:16 AM Exception in thread "main" java.lang. Error: Unresolved compilation problema: oby cannot be resolved ob cannot be resolved obcannot be resolved at heathRecord.heathRecord.main (heathRecord.java:34) Witable Smart Insert 21.38 Record.java System.out.print("Enter your first name: "); firstName input.nextLine(); System.out.print("Enter your last name:" ); lastName=input.nextLine(); System.out.println("Enter your Date of birth:"); System.out.print("\tDay:"); day-input.nextInt(); System.out.print("\tMonth: "); month=input.nextInt(); System.out.print("\tYear"); year-input.nextInt(); System.out.print("Enter your height in meter:"); height=input.nextFloat(); System.out.print("Enter your weight in kg:"); weight-input.nextFloat(); healthRecord obj = new healthRecord (firstName, lastName, month, day, year, height, weight); String BMI-""; float bmi = obj.computeBMI(); if (bmi=18.5&& bmi=25&& bmi30) BMI-"Obese"; System.out.println(" "+firstName+"age is" + obj.computeAge()); System.out.println("Your maximum heart rate is" obj.computeAge () ); System.out.printf("Your BMI is 1.21"+"..>" +BMI ,bmi); Problems Javadoc Declaration Console 1 erminated heath Record Lava Application Program Files (x86)\lavalie1.0 241\bin javaw.exe (Feb 5, 2020.938:16 AM aception in thread "main" java.lang.Error: Unresolved compilation problems: obj cannot be resolved obj cannot be resolved obj cannot be resolved at heathRecord.heathRecord.main (heathRecord.java:34) Q1. Create a health Record class for a person. The class should have the following attributes: first name last name date of birth consisting of separate instance variable for cach of month, day and year of birth) height (in m) weight (in kg) Your class should have a constructor that receives all the above attributes. For each attribute, provide set and get methods. The class also should include methods that: 1. computeAge : calculate and return the user's age in years to compute age use: 2020 minus year of birth) 2. compute MHR: calculate and return the maximum heart rate. According to the American Heart Association (AHA) (www.americanheart.org presenter.jhtml?identifier 4736), the formula for calculating your maximum heart rate in beats per minute is 220 minus your age in years 3. computeB MI: calculate and return the user's body mass index (BMI). The formula for calculating BMI is Write a festDrive class which includes your main function. In your main function: 1. Ask the user to enter his/her information as shown in the sample output below 2. Calculate and print the user's maximum heart rate 3. Calculate and print the user's BMI 4. Print the BMI category according to the following rule: BMI VALUES Underweight: less than 18.5 Normal: between 18.5 and 24.9 Overweight: between 25 and 29.9 Obese: 30 or greater Sample output (green color represents user's input): Enter your first name: Manar Enter your last name: Khalid Enter your date of birth: Day: 1 Month: 1 Year: 2000 Enter your height in meter: 1.46 Enter your weight in kg: 56 Manar's age is 19 Your maximum heart rate is 201 Your BMI is 26.27 --> Overweight

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions