Below is the main you should use and the associated output. Note: I create some instances using new just to show you a bit more, no other reason. ----------------------------main.cc----------------------------- #include < stdio.h > //the includes string.h, etc.. #include < iostream.h > #include < iomanip.h > #include <"yourincludes.h"> // this is the main that creates object instances and calls their methods int main(int argc, char *argv[]) { Dog sasha(40,"Sasha","Shepard"); // the memory is automatically allocated when entering the basic block and will be released upon exit Cat *romeo; Sprinter carl(180,"Carl Lewis"); Molecule water("water"); Hydrogen *h; Krypton kr; Pine pine(25,20); int count=0; romeo = new Cat(20,"Romeo","Mix"); h = new Hydrogen(); // you are allocating the memory cout << ++count << ". " << "sasha.name() ->" << sasha.name() << endl; cout << ++count << ". " << "romeo->name() ->" << romeo->name() << endl; cout << ++count << ". " << "romeo->mass() ->" << romeo->mass() << endl; cout << ++count << ". " << "romeo->mass(25) ->" << romeo->mass(25) << endl; cout << ++count << ". " << "romeo->mass() ->" << romeo->mass() << endl; cout << ++count << ". " << "sasha.speak() ->" << sasha.speak() << endl; cout << ++count << ". " << "romeo->speak() ->" << romeo->speak() << endl; cout << ++count << ". " << "sasha.legs() ->" << sasha.legs() << endl; cout << ++count << ". " << "sasha.hasLiveYoung() ->" << sasha.hasLiveYoung() << endl; cout << ++count << ". " << "carl.legs() ->" << carl.legs() << endl; cout << ++count << ". " << "carl.speak() ->" << carl.speak() << endl; cout << ++count << ". " << "carl.mass() ->" << carl.mass() << endl; cout << ++count << ". " << "pine.name() ->" << pine.name() << endl; cout << ++count << ". " << "pine.height() ->" << pine.height() << endl; cout << ++count << ". " << "pine.deciduous() ->" << pine.deciduous() << endl; cout << ++count << ". " << "water.mass() ->" << setiosflags(ios::fixed) << setw(9) << setiosflags(ios::showpoint) << setprecision(5) << water.mass() << endl; cout << ++count << ". " << "water.symbol() ->" << water.symbol() << endl; cout << ++count << ". " << "water.name() ->" << water.name() << endl; cout << ++count << ". " << "h->name() ->" << h->name() << endl; cout << ++count << ". " << "h->mass() ->" << h->mass() << endl; cout << ++count << ". " << "kr.mass() ->" << setprecision(1) << kr.mass() << endl; cout << ++count << ". " << "kr.family() ->" << kr.family() << endl; cout << ++count << ". " << "kr.symbol() ->" << kr.symbol() << endl; delete romeo; delete h; // you must therefore release the memory }; ------------Output--------------- 1. sasha.name() -> Sasha 2. romeo->name() -> Romeo 3. romeo->mass() -> 20 4. romeo->mass(25) -> 25 5. romeo->mass() -> 25 6. sasha.speak() -> Whof, Whoph 7. romeo->speak() -> Meow 8. sasha.legs() -> 4 9. sasha.hasLiveYoung() -> True 10. carl.legs() -> 2 11. carl.speak() -> Sorry, gotta run 12. carl.mass() -> 180 13. pine.name() -> Pine 14. pine.height() -> 20 15. pine.deciduous() -> False 16. water.mass() -> 18.01528 17. water.symbol() -> H2O 18. water.name() -> Water 19. h->name() -> Hydrogen 20. h->mass() -> 1.00794 21. kr.mass() -> 83.8 22. kr.family() -> Noble Gas 23. kr.symbol() -> Kr You must have a Makefile to compile your code: ------------example------------ sources = Sprinter.cc Cat.cc Dog.cc main.cc hw3 : $(sources) g++ -g -o hw3 $(sources) clean: rm -f hw3 *~ ======================================