Anne
Dawson: CSCI120A_LAB1_FA04.htm
Last
updated: Wednesday 15th September 2004, 8:09 PT
This
document is subject to change without notice.
Please
report any errors or omissions in this document:
adawson@coquitlamcollege.com
Special instructions:
For this assignment you may work in teams of 2, or alone. This lab is due at the end of the lab
session.
Fall 2004
Lab
Assignment 1
Specification: Calculation of Body Mass Index
(BMI)
Step 1
Study this web page:
http://www.cdc.gov/nccdphp/dnpa/bmi/bmi-adult-formula.htm
Step 2
Design an algorithm (the steps to solve the problem). You should
have the algorithm approved by your instructor before going on to the next
step.
The following web page will help you design your algorithm and
pseudocode:
http://www.coquitlamcollege.com/adawson/Pseudocode.htm
Step 3
Development the pseudocode from your algorithm.
The following web page will help you design your algorithm and
pseudocode:
http://www.coquitlamcollege.com/adawson/Pseudocode.htm
Step 4
Using your pseudocode as a guide, implement your program in the
Python language. Use the IDLE GUI to edit and run your program:
http://www.coquitlamcollege.com/adawson/Python_Editor_IDLE.htm
Your program should start with a comment block that contains the
following information:
#
File:
lab1.py
#
Purpose:
Calculation of Body Mass Index (BMI)
#
Programmer: [your name]
#
Partner: [your
partner's name]
#
Course:
CSCI120A
#
Date: Wednesday 15th September 2004
#
Reference:http://www.cdc.gov/nccdphp/dnpa/bmi/bmi-adult-formula.htm
Please note: any lines in a Python program that start with the #
symbol are known as comments. Comments are ignored when the program runs, but
are useful when we read a program, because they supply information about
the program. They are always used
at the top of a program to supply information about the purpose of a program,
its file name, the programmer etc, as shown above. They are also used in the
body of a program to explain parts of the program which may be hard to
understand. Example programs in this course will demonstrate the correct use of
comments. You are expected to supply the above set of comments (updated
appropriately) for all of your lab and homework programming assignments.
Step 5
Test your program by running the same
test data though the calculator on this web page:
http://www.cdc.gov/nccdphp/dnpa/bmi/calc-bmi.htm
Step 6
At the end of the class, save your program
file (lab1.py) to your folder on the network in:
CSCI120A\Week02\Lab01
Program
points will be based on the following marking scheme:
Marking
Scheme
|
Category |
Points |
Description |
|
Algorithm |
15 |
An informal description of the
steps that must be taken to solve the problem. |
|
Pseudocode |
15 |
A formal description of the
steps that must be taken to solve the problem. |
|
Comments |
15 |
The program should be commented as specified
in this document. |
|
Output |
15 |
Screen prompts and results should be
user-friendly. |
|
Correctness |
20 |
The program should do what is required. |
|
Style |
10 |
The source code should use meaningful variable
names. |
|
Test |
10 |
Comments in the code explain how the code was
tested. |
Assignment Presentations : In the next class, a random selection
of lab assignment programs will be presented to the CSCI120A group.