
February 20th, 2006, 06:47 PM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 18
Time spent in forums: 7 h 6 m 23 sec
Reputation Power: 0
|
|
code Code:
Original
- code Code |
|
|
|
ifndef _STUDENTREC_H
#define _STUDENTREC_H
#define NUM_OF_MARKS 5 // indexed 0-4
class studentRecord {
private:
unsigned int studentNumber;
char* _firstName;
char* _lastName;
unsigned int marks[NUM_OF_MARKS];
public:
// the default constructor
studentRecord();
// the destructor
~studentRecord();
// sets the student number of the record to studentNum.
void setStudentNumber(unsigned int studentNum);
// sets the student first name to firstName.
void setFirstName(char* firstName);
// sets the student last name to lastName.
void setLastName(char* lastName);
// sets the mark at index "index" of the student record to mark.
// the method assumes the index is in 0-4 range, and
// the mark is in 0-100 range.
void setMark(int index, unsigned int mark);
// returns the student number.
unsigned int getStudentNumber();
// returns a pointer to the first name of the student record.
char * getFirstName();
// returns a pointer to the last name of the student record.
char * getLastName();
// returns the mark at index "index" of the student record.
// it assumes the index is in 0-4 range.
unsigned int getMark(int index);
// prints the student record to the standard output in the format
// specified in the assignment specifications.
void print();
}; //studentRecord
#endif
|