// C++ example 21-9-99 part 4 main.cpp #include #include #include "legalentity.h" #include "person.h" #include "corporation.h" void main(void) { person p1("Fred Smith","1234 Ant St, Bingo, Ohio","111223333"); person p2("Jilly Smith","1234 Ant St, Bingo, Ohio","345129876"); person p3("Arthur Antelope","221B Baker St, Octopus, Idaho","001347254"); person p4("Semolina Jones","88 Eighth St, Eight, Iowa","905482123"); person p5("Bub Gratz","5251 Lemming Av, Pot, Maine","837293482"); corporation c1("Burglars, inc.","P.O.Box 23, Dingo, Florida", &p1); c1.employ(&p3); c1.employ(&p5); c1.employ(&p4); cout << "Five people:\n"; cout << " 1 " << p1.tostring() << "\n"; cout << " 2 " << p2.tostring() << "\n"; cout << " 3 " << p3.tostring() << "\n"; cout << " 4 " << p4.tostring() << "\n"; cout << " 5 " << p5.tostring() << "\n"; cout << "One corporation:\n"; c1.printall(); cout << "And finally:\n"; cout << " This person, " << p5.tostring() << "\n"; cout << " works for " << p5.getemployer()->tostring() << "\n"; cout << "The end.\n"; }