//Reads in 5 amounts of money and show how much each //amount differs from the largest amount. #include #include "money.h" int main( ) { Money amount[5], max; int i; cout << "Enter 5 amounts of money:\n"; cin >> amount[0]; max = amount[0]; for (i = 1; i < 5; i++) { cin >> amount[i]; if (max < amount[i]) max = amount[i]; //max is the largest of amount[0],..., amount[i]. } Money difference[5]; for (i = 0; i < 5; i++) difference[i] = max - amount[i]; cout << "The highest amount is " << max << endl; cout << "The amounts and their\n" << "differences from the largest are:\n"; for (i = 0; i < 5; i++) { cout << amount[i] << " off by " << difference[i] << endl; } return 0; }