Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Student Details Student Name: Student ID: CRN: Instructor: Branch: Exam Instructions - Fill the above 'Student Details' section carefully and complete. - You are advised
Student Details Student Name: Student ID: CRN: Instructor: Branch: Exam Instructions - Fill the above 'Student Details' section carefully and complete. - You are advised to count the number of pages and compare to the number written above. - Electronic devices are NOT permitted except laptop. Turn off your electronic devices and put them under your seat. - Put your ID card on your desk with your photo face up. - You are not allowed to leave the examination room during the first 30 minutes of the start of Examination. - Cheating is strictly prohibited and action will be taken. Write a complete Java program that asks the user for his / her name, height (in meters) and weight (in kilograms) and then displays the body mass index (BMI) and its category based on Table 1 . You must satis fy the following require ments in your program: 1) Create a Class named (BMI) (0.5 Mark) 2) In the Class BMI: a. Create a java method called calculateBMI to calculate the BMI based on the following formula: BMI=heightweight The method accepts the weight and height as parameters and return the BMI (2 Mark). rused on Tahie I. Tabse 1 The method aceepts the treris rame and BMA as parameters and has no return value (6 Mark). c. Is the matia method, perform the following: - Ask the user to enter hisher information (name, height, weight) (4.5.M/ark). - Call the methol (caterilate BMT) to cakculate the BMII ( Q.5Mark) - Pratt the user's name, BMI and its category using the method printResulf (o, sivari) Typical run Enter your heightin meters: 1,67 Enteryour weight in kilogramst 45 Hello Nini Your BMI is 19.72 Your category is nomal
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