0% found this document useful (0 votes)
12 views2 pages

OOP Topic Classes Quiz - 2

Uploaded by

thetechfluxyt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

OOP Topic Classes Quiz - 2

Uploaded by

thetechfluxyt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

University of Management and Technology

School of Engineering
Electrical Engineering Department

Student Name: Semester: Fall 2024


_____________________ Resource Person: Asfa Javed
Student ID: Quiz 2
________________________ Date: Nov 4, 2024
Course Title: OOP Total Marks: 10 Marks
Course Code: CS151 Time Allowed: 10 min
________________________________________________________________
_______

Question 1 (10 Marks) – CLO 1

Describe a Python program to design a function to help a local healthcare clinic automate the
calculation and categorization of Body Mass Index (BMI) for their patients. Your program will be
used by the clinic staff to assess the health of patients based on their BMI.

The clinic provides the following information for each patient:

1. Name - The patient’s full name.


2. Weight (in kg) - The patient’s weight.
3. Height (in meters) - The patient’s height.

You need to write a function in Python called calculate_bmi that takes a list of patients, with each
patient’s information stored in a dictionary (as shown below). The function should:

1. Calculate each patient’s BMI using the formula:

2. Determine each patient’s BMI category based on the calculated BMI:


 Underweight: BMI < 18.5
 Normal weight: 18.5 <= BMI < 24.9
 Overweight: 25 <= BMI < 29.9
 Obese: BMI >= 30
3. Return a list of dictionaries, where each dictionary contains:
 The patient’s name
 Their calculated BMI (rounded to two decimal places)
 Their BMI category
University of Management and Technology
School of Engineering
Electrical Engineering Department

You might also like