Anne
Dawson: CSCI101A_LAB5_SP04.htm
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.
Lab
5 Specification:
-------------------
Program
to read a file of sorted data and display the median:
#3
page 300, 4th Ed
#3
page 292, 3rd Ed
#3
page 285, 2nd Ed
Name
your source code file lab5.cpp.
Use
the following data to test your program:
10
20 30 40 50 60 70 80 90 (median is 50)
2 4
6 8 10 12 14
16 18 20 (median is (10+12)/2 = 11)
2.7 4.5
6.7 9.9 12.63 (median is 6.7)
2.5 3.2
5.1 7.5 8.3
12.74 16.7 21.67
82.8 97.1
(median is (8.3 + 12.74)/2 =
10.52
Use
Notpad.exe to create the input files which should be named:
input1.txt,
input2.txt, input3.txt and input4.txt respectively.
For this and every lab you should follow the instructions in: http://www.coquitlamcollege.com/adawson/CPP_Labs.htm
paying particular attention to the notes in blue at the bottom of
the page.
Submission
instructions:
-----------------------
At
the end of the lab session you should save just your source code file
(lab5.cpp) to your folder in CSCI101A\Week05\Lab5.
If
you are working in a team, both team members save the same file to their own
folder.
Make
sure that you include your name/s, the date and filename (lab5.cpp) in comments
at the top of the code.
Marking
Scheme :
--------------
The
following marking scheme applies:
Course
Code: CSCI101A
Semester: SP04
Assignment
Code: Lab5
Instructor
Name: Dr Anne Dawson
#3
page 300, 4th Ed
#3
page 292, 3rd Ed
#3
page 285, 2nd Ed
Student1
Name:
Student1
Number:
Student2
Name:
Student2
Number:
DESIGN
1. The program has appropriate modularity
i.e. functions are used where it makes sense
to use them. /10
2. Appropriate data types are used. /10
3. Appropriate control structures are used
(i.e. loops and decisions). /10
4. The User Interface (output to the screen) is
clear and tidy. /10
MAINTAINABILITY
5. The program is
commented appropriately - including
date,
filename and pre- and post-condition
comments /10
6. The program has meaningful identifiers. /10
7. The program is indented (spaced out)
correctly, to
aid the understanding of the code. /10
8. The code is easy to follow. /10
CORRECTNESS:
9. The program compiles with 0 errors and 0
warnings. /10
10.
Appropriate test data and results are shown in
the comments at the top of the code.
An appropriate number and variety of test
data
sets is supplied. /10
% Complete:
Total: /100
Date: