Write a program to compute the interest due, total amount due, and the minimum payment for a revolving credit account. The program accepts the account balance as input, then adds on the interest to get the total amount due. The rate schedules are the following: The interest is 1.5% on the first $1,000 and 1% on any amount over that. The minimum payment is the total amount due if that is $10 or less; otherwise, it is $10 or 10% of the total amount owed, whichever is larger. Your program should include a loop that lets the user repeat this calculation until the user says she or he is done.
#include
using namespace std;
void main()
{
double dueCost, dueInterest, minPayment, bal;
char Continue;
do
{
cout<<"Enter bal due: ";
cin>>bal;
if(bal>1000)
dueInterest = ((bal - 1000)*.01 + (1000)*.015);
else
dueInterest = bal*.015;
dueCost = bal + dueInterest;
minPayment = dueCost<=10?
dueCost : ((dueCost*.1)> 10? (dueCost*.1):10);
cout<<"\n Interest on balance: "<>Continue;
}while(Continue =='y' || Continue =='Y');
system("pause");
}
Output:
Enter balance due: 5000
Interest on balance is : 55
Total amount due is: 5055
Minimum payment is: 505.5
To repeat calculations for different variables then press 'y' or 'Y'
y
Enter balance due: 280
Interest on balance is : 4.2
Total amount due is: 284.2
Minimum payment is: 28.42
To repeat calculations for different variables then press 'y' or 'Y'
n