home *** CD-ROM | disk | FTP | other *** search
- // train3.cpp
-
- #include <iostream.h>
- #include "templts.h"
- #include "contents.h"
-
- void main()
- {
- // At Station 1
- Cow ACow;
- Passenger APassenger("Monty");
-
- RailroadCar<Cow> CarNumber1(1, ACow);
- RailroadCar<Passenger> CarNumber2(2, APassenger);
-
- CarNumber1.ShowContents();
- CarNumber2.ShowContents();
-
- // Go to Station 2...
- cout << "\n..Choo..Choo..\n\n";
-
- // At Station 2
- Cow* AtStation2Cow = CarNumber1.Unload();
- Passenger* AtStation2Passenger =
- CarNumber2.Unload();
-
- cout << "How was the trip, ";
- cout << AtStation2Passenger->GetName() << " ?";
- cout << " " << AtStation2Passenger->Complain();
- cout << "\n";
- cout << AtStation2Cow->Moo() << "\n";
- }
-