#include <iostream> #include <string> #include <iomanip> #include <fstream> using namespace std; class Car { private: string reportingMark; int carNumber; string kind; bool loaded; string destination; public: Car(); Car(const Car &c); Car(const string &mark, const int &num, const string &kd, const bool &ld, const string &dest); ~Car(); friend bool operator==(Car a,Car b); Car& operator=(const Car & carB); void output1(); void setUp(const string &mark, const int &num, const string &kd, const bool &ld, const string &dest); }; class StringOfCars { private: static const int ARRAY_SIZE=10; Car *ptr; int carCount; public: StringOfCars(); StringOfCars( const StringOfCars &obj); ~StringOfCars(); void push(Car addCar); void pop(Car &removeCar); void output2(); }; void input( StringOfCars & string1); int main() { //test 1 Car car1("SP", 34567, "business", true, "Salt Lake City"); Car car2(car1); cout<<"********************* TEST 1 ***********************"<<endl; car2.output1(); //test 2 StringOfCars string1; input(string1); cout<<"********************* TEST 2 ***********************"<<endl; string1.output2(); //test 3 Car car3; string1.pop(car3); cout<<"********************* TEST 3 ***********************"<<endl; car3.output1(); string1.output2(); return 0; } Car::Car() { reportingMark = " "; carNumber = 0; kind = "other"; loaded = false; destination= "NONE"; } Car::Car(const Car &c) { reportingMark = c.reportingMark; carNumber = c.carNumber; kind = c.kind; loaded = c.loaded; destination = c.destination; } Car::Car(const string &mark, const int &num, const string &kd, const bool &ld, const string &dest) { setUp(mark, num, kd, ld, dest); } Car:: ~Car() {} void Car::output1() { cout<<"======================================================================"<< endl; cout<< "The reportingMark: " << reportingMark << endl; cout<< "The carNumber: " << carNumber<<endl; cout<< "Kind: " << kind << endl; if(loaded=true) cout<< "Loaded: " << "true" << endl; else cout<< "Loaded: " << "false" << endl; cout<< "Destination: " << destination << endl; } void Car::setUp (const string &mark, const int &num, const string &kd, const bool &ld,const string &dest) { reportingMark = mark; carNumber = num; kind = kd; loaded = ld; destination = dest; } Car & Car::operator=(const Car & carB) { setUp(carB.reportingMark, carB.carNumber, carB.kind, carB.loaded, carB.destination); return * this; } StringOfCars::StringOfCars() { ptr= new Car[ARRAY_SIZE]; carCount=0; } //copy constructor StringOfCars::StringOfCars( const StringOfCars &obj) { int ...