This first function works, but I have to give the user a monthly payment of either "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." My rate_maker function doesn't pass the value of total_value to min_payment function's variable total_value (everything's 0's)?? Once again, I'm at an impasse!
Thank you for any help:
#include <iostream>
using namespace std;
double rate1, rate2, payment, balance, balance1, balance2, total_due;
double rate_maker(double rate1, double rate2, double balance, double balance1, double balance2, double total_due);
double min_payment(double total_due,double payment);
double rate_maker(double rate1, double rate2,double balance, double balance1,double balance2, double total_due)
{
if(balance <= 1000)
{
balance1 = balance * .015;
total_due = balance1;
return total_due;
}
else if(balance > 1000)
{
balance1 = (1000 * .015);
balance2 = (balance - 1000 * .01);
total_due = balance1 + balance2;
return total_due
;
}
}
double min_payment(double total_due, double payment)
{
if(total_due <= 10)
{
payment = total_due;
return payment;
}
else if(10 < total_due * .01)
{
payment = total_due * .01;
return payment;
}
else
{
payment = 10;
return payment;
}
}
int main()
{
double interest, monthly;
cout << "Please enter your current balance: " << endl;
cin >> balance;
interest = rate_maker(rate1,rate2,balance,balance1,balance2,total_due);
cout << "Your total due is: " << interest << endl;
cin >> total_due;
monthly = min_payment(total_due,payment);
cout <<"Your monthly payment is: " << monthly << endl;
int x;
cin >> x;
return 0;
}