// filename: moneyapp.cpp #include #include "money.h" using namespace std;; int main() { Money mar[3]; mar[0] = Money(5, 20); mar[1] = Money(19, 9); mar[2] = Money(1, 75); // // Write your code here // int total = 0; for (int i = 0; i < 3; i++) total = total + mar[i].toAllCents(); Money sum(total); // convert constructor sum.printMoney(); cout << endl; // // Swap mar[0] and mar[1] // Money temp(mar[0]); // copy constructor mar[0] = mar[1]; // structure copy mar[1] = temp; // ditto return 0; }