Anne
Dawson: CSCI101A_LAB3_SP05.htm
Last
updated: Thursday 27th January 2005, 8:31 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.
Spring 2005
Lab Assignment 3
Step 1
Study the following:
#11 on page 222 of the 4th
Edition.
PLEASE NOTE: there is an error in the
textbook (4th ed):
Question 11 on page 222 ends after
the first sentence on page 223:
. . . for illegal combinations. The
next sentence: In cold weather . . .
starts the next question, Question
12.
#11 on page 219 of 3rd edition
#11 on page 213 of 2nd edition
Note: you do not type in the code
of your program until Step 4.
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 C++ language. Use either the Borland or Dev-C++
IDE to edit and run your program.
Your program should start with a comment block that contains the following information:
// File: lab3.cpp
// Purpose: #11 on page 222 of the 4th Edition.
// Purpose: #11 on page 219 of the 3rd Edition.
// Purpose: #11 on page 213 of the 2nd Edition.
// Programmer: [your name]
// Partner: [your partner's name]
// Course: CSCI101A
// Date: Thursday 27th January 2005
// Test data:
Please note: any lines in a C++
program that start with the // symbols 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 supplying your own test data. You should
test your program with at least 3 sets of test data. Show your test data and
results in comments at the top of your program.
Step 6
At the end of the class, save your program file (lab3.cpp) to your
folder on the network in:
CSCI101A\Week04\Lab03
Program points will be based on the
following marking scheme:
Marking Scheme: CSCI101A - Lab 3
- GPA Calculations
Student name(s):
|
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 |
10 |
The program is commented appropriately. |
|
Style |
15 |
The source code should use meaningful variable
names (identifiers). |
|
Output |
15 |
Screen prompts and results should be
user-friendly. |
|
Correctness |
10 |
The program should output correct results. |
|
Completeness |
10 |
The program should be complete. |
|
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 CSCI101A group.