home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ for Dummies (3rd Edition)
/
C_FD.iso
/
CHAP10
/
CHAP10_1.CPP
next >
Wrap
C/C++ Source or Header
|
1996-09-02
|
671b
|
49 lines
// Chap10_1.cpp
#include <iostream.h>
class Student
{
public:
Student()
{
cout << "constructing student\n";
semesterHours = 0;
gpa = 0.0;
}
//...other public members...
protected:
int semesterHours;
float gpa;
};
class Teacher
{
public:
Teacher()
{
cout << "constructing teacher\n";
}
};
class TutorPair
{
public:
TutorPair()
{
cout << "constructing tutor pair\n";
noMeetings = 0;
}
protected:
Student student;
Teacher teacher;
int noMeetings;
};
int main()
{
TutorPair tp;
cout << "back in main\n";
return 0;
}