1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
//lab4.cpp//
#include "TelephoneNumber.h"
#include "WorkingTN.h"
#include "BillingTN.h"
using namespace std;
ostream &operator << (ostream &Out, TelephoneNumber &TN)
{
TN.PrintToStream(Out);
return Out;
}
void main()
{
//Declaring Telephone Objects
TelephoneNumber YourNumber;
TelephoneNumber Paul("719", "590", "6768");
TelephoneNumber Bob("719", "590", "6729");
WorkingTN CSStaff1("719", "590", "6732", "Book Store");
WorkingTN CSStaff2("212", "371", "6940", "Borland C++ Guru");
WorkingTN CSStaff3("405", "612", "3433", "Visual C++ Expert");
BillingTN CSDept("719", "590", "6850", "Dean of CS");
BillingTN Library("719", "598", "6708", "Librarian");
BillingTN Reception("719", "598", "0200", "Receptionist", 35);
cout << "Testing the overloaded << operator with the virtual" << "PrintToStream() \n";
cout << "\nThe Telephone numbers are: \n";
cout << YourNumber << endl;
cout << Paul << endl;
cout << Bob << endl;
cout << "\nThe working Telephone numbers are: \n";
cout << CSStaff1 << endl;
cout << CSStaff2 << endl;
cout << CSStaff3 << endl;
cout << "\nThe Billing Telephones numbers are: \n";
cout << CSDept << endl;
cout << Library << endl;
cout << Reception << endl;
cout << "End Tests of Telephone hierachy!" << endl;
}
|