// 22.5HV2 Software Engineering II // Unit 3 Exercise 3 #include #include #include "change.h" void main() { Change purse(0,0,2,1,3,2,4),change; float amount; cout << "Purse contains: " << purse << endl; cout << "Enter change: "; cin >> change; purse += change; cout << "Purse now contains: " << purse << endl; cout << "Enter amount of money: "; cin >> amount; if (purse < amount) cout << "Sorry, I can't afford this!" << endl; else purse -= amount; // check purse and if correct // change available pay up cout << "Purse now contains: " << purse << endl; cout << setprecision(2) << setiosflags(ios::showpoint); cout << "Total amount = £" << float(purse) << endl; }