Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

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

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

13.6 Explain how to set up aflexible benefits program.

Answered: 1 week ago