Académique Documents
Professionnel Documents
Culture Documents
1. Develop a C++ program that will determine if a department store customer has exceeded the credit limit
on a charge account. For each customer, the following facts are available:
i. Account number
ii. Balance at the beginning of the month
iii. Total of all items charged by this customer this month
iv. Total of all credits applied to this customer’s account this month
v. Allowed credit limit
The program should input each of this facts, calculate the new balance (=ii + iii - iv), and determine if the
new balance exceeds the customer’s credit limit (v). For those customers whose credit limit is exceeded,
the program should display the customer’s account number, credit limit, new balance and the message
“Credit limit exceeded.”
Example of Input/Output:
Enter account number (-1 to end): 100
Enter beginning balance: 5394.78
Enter total charges: 1000.00
Enter total credits: 500.00
Enter credit limit: 5500.00
Account: 100
Credit limit: 5500.00
Balance: 5894.78
Credit limit Exceeded
/*
Name : xxx
Date : 280208
Description : Assignment
Made with Dev C++ 4.9.9.2
*/
#include <iostream>
#include <iomanip>
#include <cstdlib>
int main()
{//open main
int account_number;
float balance, charges, credits, limit;
//get input
cout<<"\n\t+++++++++++++++++++++++++++++++++++++++++++++++++++";
cout<<"\n\n\t\t\tCREDIT COUNTER<tm>"<<endl;
cout<<"\n\t+++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\n\t___________________________________________________"<<endl<<endl;
//compute
cout<<"\n\t___________________________________________________"<<endl<<endl;
cout<<"\n\t...................................................."<<endl<<endl;
}
cout<<"\n\t___________________________________________________"<<endl<<endl;
}
cout<<"\nInvalid Account Number. Please Try Again"<<endl<<endl;
cout<<endl;
system ("pause");
}//end main
console application