/************************************************** *** Chapter two...lab one by dustin luca *** *** *** **************************************************/ #include using std::cout; using std::cin; using std::endl; using std::fixed; #include using std::setprecision; int main() { int accountNumber; //customer account number double balance; //customer balance double charges; //charges on the account double credits; //credits to the account double limit; //credit limit on the account cout << "Enter account number (-1 to end): " << fixed; std::cin >> accountNumber; while (accountNumber > -1) { /* beginning of all of the actual looping right HERE */ cout << "\nAccount #" << accountNumber << " logged on. \nEnter beginning balance: $"; std::cin >> balance; cout << "Enter total charges for month: "; std::cin >> charges; cout << "Enter price of purchase: $"; std::cin >> credits; cout << "Enter credit limit on account #" << accountNumber << ": $"; std::cin >> limit; cout << "\n_______________________________________________"; cout << "\nBalance prior to purhcase: " << balance; cout << "\nBalance after purchase: " << balance + credits << "\n"; cout << "Credit limit: $" << limit << ". \n"; cout << "_______________________________________________\n"; if (credits + balance >= limit) cout << "Authorization failed: insufficient credit limit."; else cout << "Authorization passed: new balance: $" << balance + credits << ". \nThank you, and have a nice day."; cout << "\n_______________________________________________"; cout << "\n\n\nEnter account number (-1 to end): " << fixed; std::cin >> accountNumber; } /* end of all of the looping and all of that othe stuff */ cout << "Thank you, and have a good day. \nProgram made by Dustin Luca!" << endl; //ends any running outputs return 0; } //end main