Ok so I've got this homework problem thats killing me. Here's the problem:
A bank account charges $10 per month plus the following check fees for a commercial checking account:
$.10 each for fewer than 20 checks
$.08 each for 20-39 checks
$.06 each for 40-59 checks
$.04 each for 60 or more checks
The bank also charges an extra $15 if the balance of the account falls below $400(before any check fees are applied). Write a program that asks for the beginning balance and the number of checks written. Compute and display the bank's service fees for the month.
*Input validation*: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn. This is the source code I got now(I've written like 5 of em)(please don't laugh)
#include <iostream>
using namespace std;
int main()
{
int checks = 0;
double balance,fee;
cout << "Hello What's Your Balance? "<<endl;
cin >> balance;
if (balance <400 && >=0 ) {
cout << "HOW MANY CHECKS HAVE YOU WRITTEN?";
cin >> checks;
if (checks < 0) {
cout "Can't do that";
}
if (checks < 20 ) {
fee = .10 * checks + 10 + 15;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}
else if (checks <=39 && checks >=20){
fee = .08 * checks + 10 + 15;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}else if (checks <=59 && checks >=40 ){
fee = .06 * checks + 10 + 15;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}else if (checks >60 ){
fee = .04 * checks + 10 + 15;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}
else {
fee = .10 * checks + 10 + 15;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}
}
else if ( balance >=400){
cout << "HOW MANY CHECKS HAVE YOU WRITTEN?";
cin >> checks;
if (checks < 20) {
fee = .10 * checks + 10 ;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}
else if (checks <=39 && checks >=20){
fee = .08 * checks + 10 ;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}else if (checks <=59 && checks >=40 ){
fee = .06 * checks + 10 ;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}else if (checks >60 ){
fee = .04 * checks + 10 ;
cout << " Bank Service charges for the month is "<< fee << " Dollars "<<endl;
}
else if {
fee = .10 * checks + 10 ;
cout << " Bank Service charges for the month is "<< fee << " Dollars ";
}
}
}
Can a kind soul please help me with this. By, the way this source code has numerous errors in it but I just wanted to show everyone where I was going with it. The thing thats really throwing me off is the input validation part. If that wasn't there, I could do this no problem(lol I think) So can somebody please help me, I really wanna get this program done and get a full grasp of it