This is his code:
Code:
//Cheers for any help CH
// Craig harper Code for student/person class
// 12/08/2003
// Problem lines are marked with comments
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
class Person
{
public:
Person() {
};
~Person() {
};
unsigned long int getLibraryNumber();
void SetLibraryNumber (unsigned long int);
char GetSurname();
void SetSurname(char);
char GetFirstName();
void SetFirstName(char);
char GetTitle();
void SetTitle(char);
protected:
unsigned long int LibraryNumber;
char Surname[50];
char Forename[30];
char Title[5];
};
class Student
{
public:
Student() {
};
~Student() {
};
char GetDepartment();
void SetDepartment(char);
int GetCourse();
void SetCourse(int);
protected:
char Department[30];
int Course;
};
void doEnterStudents();
void doEnterStaff();
void doPrintRecordsStudents();
void doPrintRecordsStaff();
void doEnterStudents()
{
int Counter;
char Surname[50], Name[30], title[5], department[30];
int LibNo, course;
for (Counter =0; Counter <10; Counter++)
Student.counter = new Student ; //parse error before '.'
cout << "What is your library number?\n";
cin >> LibNo;
Student.SetLibraryNumber(LibNo); //parse error before '.'
cout << "What is your surname?\n";
cin.getline(Surname, 50, '\n');
Student.SetSurname(Surname); //parse error before '.'
cout << "What is your First Names?\n";
cin >> Name;
Student.SetFirstName(Name); //parse error before '.'
cout << "What is your Title?\n";
cin >> title;
Student.SetTitle(title); //parse error before '.'
cout << "what is your department?\n";
cin >> department;
Student[Counter].SetDepartment(Dept); //parse error before '.'
cout << "what is your Course Number?\n";
cin >> course;
Student[Counter].SetCourse(course);
system ("PAUSE");
}
void doEnterStaff()
{
cout << "the enter staff will go here";
system ("PAUSE");
return ;
}
void doPrintRecordsStaff()
{
cout << "Print Staff will go here";
system ("PAUSE");
return ;
}
void doPrintRecordsStudents()
{
cout << "Print students will go here";
system ("PAUSE");
return ;
}
int main(int argc, char *argv[])
{
int menuChoice;
cout << "Please chose your menu choice\n";
cout << "1: Enter The New Students\n";
cout << "2: Enter The New Staff\n";
cout << "3: Print All Staff\n";
cout << "4: Print All Students\n";
cout << "5: Exit this program\n";
cin >> menuChoice;
switch (menuChoice)
{
case 1: doEnterStudents;
case 2: doEnterStaff;
break;
case 3: doPrintRecordsStudents;
break;
case 4: doPrintRecordsStaff;
break;
case 5: cout << "Thankyou good bye";
break;
default:
cout << "Thats not in the menu";
break;
system ("pause");
int holdScreen;
std::cin >> holdScreen;
return 0;
}
}