Study Guides (390,000)
CA (150,000)
York (10,000)
ITEC (100)
Quiz

ITEC 2600 Study Guide - Quiz Guide: Underweight, MoodleExam


Department
Information Technology
Course Code
ITEC 2600
Professor
Xiaofeng Zhou
Study Guide
Quiz

This preview shows half of the first page. to view the full 2 pages of the document.
York University ITEC2600 Winter2020 X.Zhou
ITEC 2600
Introduction to Analytical Programming
Lab Quiz 1
Section O
Objectives
1. This is the first lab quiz.
2. You could use your lecture notes, reference books, BUT NO discussion, YOU MUST work
out your own solutions.
3. You must submit your lab quiz file(s) to moodle before 7:00pm, Feb 5, 2020.
4. At the top of each file introduce your name and student ID as comments.
5. Document your codes/commands well.
Questions
1. Body mass index (BMI)is a measure of obesity. In standard units, it is calculated by the
formula
BM I = 703 W
H2
where Wis weight in pounds, and His height in inches. The obesity classication is: 1
BMI Classication
Below 18.5 Underweight
18.5 to 24.9 Normal
25 to 29.9 Overweight
30 and above Obese
(a) Write an anonymous function to calculate the BMI.
(b) Write a user-dened function to convert the weight from kg to pound, and height from
cm to inch, where 1kg = 2.2046lb, and 1inch = 2.54cm.
(c) You are given a simulated data le named bodyinfo’xlsx that contains weight (in
kg) and height (in cm) for 20 people. The rst column is the ID number, the second
coulumn is the weight, and third column is the height. Write a program in a script le
that calculates the BMI of a person. The program reads the weight and height from
data le, calculate BMI by calling anonymous function in a) and user-dened function
in b), and display the results(rounded to 2 decimal places).
Evaluation
1Textbook: An introduction with Application.
1
You're Reading a Preview

Unlock to view full version