/*---- signature: main: void -> int purpose: playing with now-completed version of Team class compile using: g++ 112lect08-2.cpp PlayerChar.cpp Team.cpp -o 112lect08-2 run using: ./112lect08-2 by: Sharon Tuttle last modified: 2022-10-11 ----*/ #include <cstdlib> #include <iostream> #include <string> #include <cmath> #include "PlayerChar.h" #include "Team.h" using namespace std; int main() { cout << boolalpha; Team team1("Humboldt", 3); Team team2; cout << "team1:"; team1.display(); cout << "team2:"; team2.display(); team2 = team1; cout << "after assign team1 to team2: " << endl; cout << "team1:"; team1.display(); cout << "team2:"; team2.display(); cout << "team1 and team2 ARE separate objects in memory: " << endl; cout << "&team1: " << &team1 << endl; cout << "&team2: " << &team2 << endl; PlayerChar alphonse("Alphonse", 25, 10.6, "armour", 30); PlayerChar edward; team1.set_player(alphonse, 2); cout << endl << "after assign Alphonse to team1: " << endl; cout << "team1:"; team1.display(); cout << "team2:"; team2.display(); // turns out that this uses the copy constructor // instead of overloaded assignment, // when you initialize a newly-declared object // to another existing object Team team3 = team1; cout << "after initialize team3 to team1: " << endl; cout << "team3:"; team3.display(); cout << "team1:"; team1.display(); cout << "team1 and team3 ARE separate objects in memory: " << endl; cout << "&team1: " << &team1 << endl; cout << "&team3: " << &team3 << endl; edward.set_name("Edward"); team3.set_player(edward, 1); cout << endl << "after assign Edward to team3: " << endl; cout << "team3:"; team3.display(); cout << "team1:"; team1.display(); cout << "is team1 bigger than team3? should be false:" << endl; cout << team1.is_bigger_than(team3) << endl; return EXIT_SUCCESS; }