// This program determines if a department-store customer has exceeded the credit limit on a
// charge account by using a sentinel control while loop.
#include <iostream>
using namespace std;
#include <iomanip>
int main ()
{
int accountNumber; // customers account number
double balance; // customers 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;
cin >> accountNumber;
while (accountNumber !=-1)
{
cout << "Enter beggining balance: ";
cin >> balance;
cout << "Enter total charges: ";
cin >> charges;
cout << "Enter total credits ";
cin >> credits;
cout << "Enter credit limit ";
cin >> limit;
double newbalance = (balance + charges - credits);
if (newbalance>limit) // if credit limit exceeds, error message displays
{
cout <<"Account: " << accountNumber << endl;
cout <<"Credit Limit: " << setprecision(2) << fixed << limit << endl;
cout <<"Balance " << setprecision(2) << fixed << newbalance << endl;
cout << "Credit Limit Exceeded." << endl;
}
cout << "\nEnter account number (-1 to end) : ";
cin >> accountNumber;
} // end while loop
return 0;
}

oh my god

