Anne
Dawson: CSCI101A_LAB5_SP05.htm
Last
updated: Thursday 10th February 2005, 6:58 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.
Lab
5 Specification:
-------------------
Write
a grading program for a computer science course. The following grading policy
applies:
a.
The are two quizzes, each graded on the basis of 10 points.
b.
There is one midterm exam and one final exam, each graded on the basis of 100
points.
c.
The final exam counts for 50% of the overall grade, the midterm counts for 30%,
the two quizzes together count for a total of 20%. Don't forget to normalize
the quiz scores: they should be converted to percentages before they are
averaged in to the final grade. The grading is simple: >= 50 is 'P' pass,
< 50 is 'F' fail.
You
should define a class to store the student record (collection of scores). There
should be an instance variable for the each quiz and exam, and instance
variables to store the student number, overall numeric score and the final
letter grade.
The
overall numeric score is a number in the range 0 - 100, which represents the
weighted average of the student's work.
The
class should have input and output member functions. The input member function
should ask for the student number (a number on the range 0 to 32), and the quiz
and exam scores. No other data are inputted.
The
overall numeric score and letter grade are calculated by member functions. The
member functions which calculate the overall score and letter grade are void
functions that set the appropriate instance variables. If you wish, you can create other
member functions. Remember that one member function can call another member
function.
Make
all member functions (apart from any helping member functions) public, and all
instance variables private. Use at least one accessor and one mutator method
(see notes and textbook if you’re not sure what these are).
There
should be one default constructor which sets all instance variables to 0 (for
scores) and to the character '-' for the letter grade.
You should be familiar with program 06-06.cpp before starting this
assignment.
Name
your source code file lab5.cpp.
Use
the following data to test your program:
Quiz
1 (out of 10) = 5 Weight = 10% 5/10 * 10 = 5
Quiz
2 (out of 10) = 7 Weight = 10% 7/10 * 10 = 7
Midterm
(out of 100)=67 Weight =
30% 67/100 * 30 = 20.1
Final
(out of 100) = 78 Weight = 50% 78/100 * 50 = 39
Overall score (out of 100) = 71.1
Letter grade = P
Submission
instructions:
-----------------------
At
the end of the lab session you should save just your source code file
(lab5.cpp) to your folder in CSCI101A\Week06\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: SP05
Assignment
Code: Lab5
Instructor
Name: Dr Anne Dawson
Assignment: A grading
program using a class
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 for all functions /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: