Just started a beginners class and can't get my do while loop to work. Can anyone help me with this. The rest of the program works how I expected it to work.
#include <iostream>
using namespace std;
do {
cout << "Please enter your account balance: " <<endl;
cin >> accountBalance;
if (accountBalance <=10)
{
cout << "Interest Due: " << (accountBalance * interest) <<endl;
cout << "Total Due: " << (accountBalance) +(accountBalance * interest) << endl;
cout << "Would you like to enter another amount? Enter Y for yes or N for no" <<endl;
cin >> doAgain;
}
else if ((accountBalance >10)&&(accountBalance <=98))
{
balance = (accountBalance) + (accountBalance * interest);
cout << "Interest Due: " <<accountBalance * 0.015 <<endl;
cout << "Total Due: " <<balance << endl;
cout << "Min Due: " << 10 << endl;
cout << "Would you like to enter another amount? Enter Y for yes or N for no" <<endl;
cin >> doAgain;
}
else if ((accountBalance >=99) && (accountBalance <=1000))
{
balance = (accountBalance) + (accountBalance * interest);
cout << "Interest Due: " << accountBalance * interest <<endl;
cout << "Total Due: " << balance <<endl;
cout << "Minimum Payment Due: " << balance * 0.10 <<endl;
cout << "Would you like to enter another amount? Enter Y for yes or N for no" <<endl;
cin >> doAgain;
}
else if (accountBalance >1000)
{
firstThousand =(1000);
balanceOverThousand = ((((accountBalance-1000) * extraInterest))+ ((firstThousand)*interest));
cout << "Interest Due: " << balanceOverThousand <<endl;
cout << "Total Due: " << (balanceOverThousand + accountBalance) <<endl;
cout << "Minimum Payment Due: " << (balanceOverThousand + accountBalance) * 0.10;
cout << "Would you like to enter another amount? Enter Y for yes or N for no" <<endl;
cin >> doAgain;
}
}while (doAgain = 'y' || doAgain = 'Y');
But, hey.. keep talking out of your ass and filling the forums with misinformation and novice code while pretending you're an expert. I'm sure you're impressing yourself.
This sort of disgraceful language, exaggeration and bullying will not be tolerated Cire. Stop it and apologise.
.