You are on page 1of 1

3p8

#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double net_balance , payment , rate_per_month ,
avrg_daily_balance , interest ;
int d1 ,d2 ;
cout << "Enter net balance :" << endl;
cin >> net_balance ;
cout << "Enter payments made :" << endl;
cin >> payment ;
cout << "Enter number of days in billing cycle :" << endl;
cin >> d1 ;
cout << "Enter number of days when payment "
<<"is made before billing cycle :" << endl;
cin >> d2 ;
cout << "Enter interest rate per month :" << endl ;
cin >> rate_per_month ;
avrg_daily_balance = (net_balance*d1-payment*d2)/d1 ;
interest = avrg_daily_balance * rate_per_month ;
cout << fixed << showpoint << setprecision (2) ;
cout << "interest = " << interest << endl ;
return 0;
}

You might also like