Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PL Write a java program that has the following methods: A method called bodyMass that takes as parameter a double value called weight. The method

image text in transcribed

PL Write a java program that has the following methods: A method called bodyMass that takes as parameter a double value called weight. The method should check the weight and return a string describing the body mass as following: "Overweight" is for weight greater than 90 kg "Fat" is for weight between 70 and 90 both included "Ideal" is for weight between 55 and 69 both included "Thin" is for weight between 45 and 54 both included "Underweight" is for weight less than 45 The main method asks the user to enter the name and weight of 6 ladies (using a loop) and prints their body mass description by invoking the method body Mass as per the following sample run. Using java Page 1 of 2 CSCI250L Fall 2021 - 2022 .. Sample Input and Output: Enter the name and the weight of lady 1: Rola 60 Rola is Ideal Enter the name and the weight of lady 2: Petra 40 Petra is Underweight Enter the name and the weight of lady 3 : Samira 48 Samira is Thin Enter the name and the weight of lady 4 : Rana 100 Rana is overweight Enter the name and the weight of lady 5: Tia 58 Tia is Ideal Enter the name and the weight of lady 6 : Lamar 80 Lamar is Fat PL Write a java program that has the following methods: A method called bodyMass that takes as parameter a double value called weight. The method should check the weight and return a string describing the body mass as following: "Overweight" is for weight greater than 90 kg "Fat" is for weight between 70 and 90 both included "Ideal" is for weight between 55 and 69 both included "Thin" is for weight between 45 and 54 both included "Underweight" is for weight less than 45 The main method asks the user to enter the name and weight of 6 ladies (using a loop) and prints their body mass description by invoking the method body Mass as per the following sample run. Using java Page 1 of 2 CSCI250L Fall 2021 - 2022 .. Sample Input and Output: Enter the name and the weight of lady 1: Rola 60 Rola is Ideal Enter the name and the weight of lady 2: Petra 40 Petra is Underweight Enter the name and the weight of lady 3 : Samira 48 Samira is Thin Enter the name and the weight of lady 4 : Rana 100 Rana is overweight Enter the name and the weight of lady 5: Tia 58 Tia is Ideal Enter the name and the weight of lady 6 : Lamar 80 Lamar is Fat

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions