Ok so, I feared this would happen when I compiled and ran, and surely enough it did.
I'm getting a logical error within this program and i cant figure out how to fix it. I want to make it so that when I enter any of the numbers between 0 - 19, 20 - 39, 40 - 59, or 60+, it will only do the calculation of the entered number by the specific decimal value assigned to that group of numbers. Take a look at my code and you'll understand what im talking about
Code:#include <iostream> using namespace std; int main() { double checkAmount; int monthBankCharge = 10; cout << "Enter the amount of checks you've written in the past month\n"; cin >> checkAmount; if (checkAmount < 20) { cout << checkAmount * 0.10 << endl;} else if (checkAmount >= 20) { cout << checkAmount * 0.08 << endl;} else if (checkAmount >= 40) { cout << checkAmount * 0.06 << endl;} else if (checkAmount >= 60) { cout << checkAmount * 0.04 << endl;} system("pause"); return 0; }



LinkBack URL
About LinkBacks


