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.
  1. 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 cstest.cpp
  2. The private data members in the CSStudent class should include
  3. 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
  4. 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, etc)
  5. 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 << ?)
  6. Test the CSStudent class by creating a short driver program cstest.cpp 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.

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:
Assignments 15%
Lab 20%
Midterm Test 15%
Final exam 50%