CS 1711 Lab 6 - November 9 and 11, 1999
In this lab we will continue working with class files . In the problem
below, please be sure to save your program to demonstrate to the lab instructor.
Required files are to be found in T:\comp_sci\cs1711\
Writing a new Class
In this question you will get some practice at creating a new class and
writing a `driver' program to test its implementation.
You may choose to use (and modify) the class descriptions in graderec.h
or mygdrec.h from Lab 5.
Create a project on your M: drive called CSStudent in
a lab6 directory. The project should
include a class definition file csstudent.h and a driver program
The private data members in the CSStudent class should include
There should be a constructor for CSStudent, and it should require
a student name, student ID and section, and should set (as defaults) the
numeric values to 0
The methods (member functions) should include the ability to SET the section
and each of the numeric data members midterm, lab, exam, as well as to
GET each of the private data members. (eg setMidterm, getID,
There should be a method (member function) named grade which will
return the calculated grade (a real) based on the scores on the assignments, midterm,
lab, and exam data members. There should also be a display method which
will display the student name , ID, and section, as well as assignment, midterm, lab,
and exam marks (using cout << ?)
Test the CSStudent class by creating a short driver program
which will prompt for the input of: your name, ID and
section , and will create an object named <yourname> whose ID is <yourID>.
It will then display the information on <yourname>, and prompt you to
enter data to be used to modify the numeric data members: assignment, midterm, lab, and exam.
You should enter the data for your midterm mark, and any (reasonable) mark of less
than 100 on the lab and on the final exam. Once this
data is entered the program should display your grade in the course.
name (last name, a String)
(a character, 'A', 'B', etc)
assignments (an integer mark out of 100
on the assignments)
(an integer mark out of 100 on the labs)
(an integer mark out of 100 on the midterm)
(an integer mark out of 100 on the final exam
End of Lab NOTE: There is a Lab Test scheduled for Nov. 16 and 18
As given on the course desription page at http://www.mta.ca/~rrosebru/171199/171199.html
the course mark is determined as follows: