after changing the program a bit, i still couldn't solve it
heres the new program <Though it doesnt have much of a difference>
Code:
//This program is used to find the amount of time needed to compleete the payment of value
//with the interest rate of 1.5% and where the user can only spare $50 to pay off
//everything. Meaning out of the $50, the user must pay the interest which is 1.5% of the debt
//and the leftover of the $50 is used to pay off the debt.
#include <iostream>
#include <iomanip>
using namespace std;
void main()
{
float value;
value = 1000;
int number;
number = 0;
float interest;
float totalInterest;
totalInterest = 0;
float amount;
amount = 50;
while (value > 0)
{
interest = value * 0.015;
amount -= interest;
value -= amount;
totalInterest = totalInterest + interest;
number++;
if (value == 100)
{
break;
}
else
{
cout<<"The amount of times this process is repeated is "<<number<<endl;
cout<<"The total amount of the interest is "<<totalInterest<<endl;
cout<<"The amount left is "<<value<<endl;
}
}
}