So, I was finishing up my code to my ledger that calculates a running total on a set of transactions and I got to my last else statement and it told that I needed a ";" before the "{" which I thought was weird because I have never done that before. So I put the ";" right before the "{" and the code runs perfectly fine. Can anyone explain this??
1 2 3 4
else (NewBalance > 10000); {
intRate = .05 * NewBalance;
cout << "You have earned $" << intRate << " in interest at 5%" << endl;
}
Here is my whole code if anyone can figure out where I may have went wrong... I am getting an error when I run this program. When I run this it will output that last else statement even if say the total is 6000 and not over 10000 like I am telling it to do.