[Solved] Measurement

$25

File Name: Measurement.zip
File Size: 103.62 KB

SKU: [Solved] Measurement Category: Tag:
5/5 - (1 vote)

ObjectiveThe objective of this problem is to introduce a simple Object-Oriented Programming (OOP) problem and ensure that students understand the concept of OOP. In this case, its tested with the understanding of object.Problem DescriptionGiven a group of people with different heights and weights, determine the shortest and tallest people in the group, and calculate their body mass index (BMI).The formula for BMI isBMI =InputThe first line of the input contains an integer N (2 <= N <= 100) denoting the number of people in the group. The next N lines contain the information (name, height in centimeters, and weight in kilograms) of the people in the group.OutputOutput the name of the shortest and tallest people in the group, assuming that there is only one shortest person and one tallest person in the group.Suppose A is the shortest and B is the tallest person in the group, the output will be:A is the shortest with BMI equals to C.B is the tallest with BMI equals to D.Output the BMI value correct to 2 decimal places.Please refer to sample output for more details.Sample Input4Diamond 178 55Jarod 160 80Douglas 180 60Rod 151 48Sample OutputRod is the shortest with BMI equals to 21.05.Douglas is the tallest with BMI equals to 18.52.ExplanationBMI for Rod =BMI for Douglas = 2Algorithm Template1. How are you going to store a tuple of (name, height and weight)?2. How to compare which one is the smallest or tallest?3. How to output the answer in 2 decimal places?

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Measurement
$25