0% found this document useful (0 votes)
55 views

ICS3U Function Assignment2a

This document provides instructions for an assignment to create a Python program that calculates body mass index (BMI). It asks students to write functions to calculate BMI using either metric or imperial units, get user input for name, measurement system, height, and weight, then output the user's BMI statistics and classification. The program should define functions at the top to appropriately incorporate subprograms with parameter passing and variable scope.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

ICS3U Function Assignment2a

This document provides instructions for an assignment to create a Python program that calculates body mass index (BMI). It asks students to write functions to calculate BMI using either metric or imperial units, get user input for name, measurement system, height, and weight, then output the user's BMI statistics and classification. The program should define functions at the top to appropriately incorporate subprograms with parameter passing and variable scope.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ICS3U - User Defined Function Assignment

These exercises focus on function basics.


- def keyword
- call back
- argument(s)
- return statement
- variable scope (local/global)
- IPO model

Create Python programs to do the following:

1. The calculation for body mass index (BMI), depends on the units given for weight and height.
Metric calculation: weight is given in kilograms and height in metres and the formula is as
follows:

Imperial calculation: weight is given in pounds and height in inches and the formula is

The meanings of the scores are as follows:

 Less than 18.5  underweight


 18.5 – 25  normal
 Over 25 but less than 30  overweight
 30 and over  obese

Instructions

Write a python program to include your own functions in its design. It should still ask the user for
their name, a system of measurement to use (imperial or metric), their height, their weight, and then
calculates their BMI. Output should be a message to the user reiterating their statistics and stating
their BMI and what it means. TIP: You must use functions where appropriate and define them
at the top of your program.

Sample output:
Donald, with a height of 72 inches and a weight of 170 pounds, you
have a BMI of 23. This is considered normal.

Save as bodyMassIndexFunc.py
Rubric
Level 1 Level 2 Level 3 Level 4
Categories
(50 - 59%) (60 - 69%) (70 - 79%) (80 - 100%)
A3.2 write subprograms -writes a subprogram - writes a - writes a - writes a subprogram
(e.g., functions, procedures) program with limited subprogram program subprogram program program with a high
that use parameter passing effectiveness with some with considerable degree of effectiveness
and appropriate variable effectiveness effectiveness
scope (e.g., local, global), to
perform
tasks within programs.

Note: A student whose achievement is below Level 1 (50%) has not met the expectations for this
assignment or activity.

You might also like