BANK CHARGES A bank charges $10 per month plus the following check fees for a co
ID: 3553373 • Letter: B
Question
BANK CHARGES
A bank charges $10 per month plus the following check fees for a commercial checking account:
$.10 each for fewer than 20 checks
$.08 each for 40-59 checks
$.06 each for 40-59 checks
$.04 each for 60 or more checks
write a program that asks for the number of checks written during the past month, then computes and displays the bank's fees for the
month.
input validation: Decide how the program should handle an input of less than 0.
FAT GRAM CALCULATOR
Write a program that asks for the number of calories and fat grams in a food. The program should display the percentages of calories that come from fat. If the calories that come from fat are less than 30 per cent of the total calories of the food, it should also display a
message indicating the food is low in fat.
one gram of fat has 9 calories, from fat = fat grams *9
The percent of calories from fat can be calculated as
calories from fat / total calories
input validation: the program should make sure that the number of calories is greater than 0, the number of fat grams is 0 or more, and the number of calories from is not greater than the total number of calories.
Explanation / Answer
Program: BANK Charges
//Header file section
#include<iostream>
using namespace std;
//Main function
void main()
{
//Variable declarations
int beginningbalance,checks;
double total,bankservicefees;
//inputting balance
cout<<"Enter beginning balance"<<endl;
cin>>beginningbalance;
//inputting checks
cout<<"Enter number of checks written on this month"<<endl;
cin>>checks;
if(checks <0)
{
cout<<"Account Overdrawn"<<endl;
}
if(checks<20 && beginningbalance > 400)
{
total = checks*0.10;
bankservicefees = (10+total);
cout<<"Total bank service fees for the month is $"<<bankservicefees<<endl;
}
if(checks<20 && beginningbalance < 400)
{
total = checks*0.10;
bankservicefees = (10+total+15);
cout<<"Total bank service fees for the month is $"<<bankservicefees<<endl;
}
if(checks >= 20 && checks <=39)
{
if(beginningbalance > 400)
{
total = checks*0.08;
bankservicefees = (10+total);
cout<<"Total bank service fees for the month is $" <<bankservicefees<<endl;
}
}
if(checks >= 20 && checks <=39)
{
if(beginningbalance < 400)
{
total = checks*0.08;
bankservicefees = (10+total+15);
cout<<"Total bank service fees for the month is $" <<bankservicefees<<endl;
}
}
if(checks >= 40 && checks <=59)
{
if(beginningbalance > 400)
{
total = checks*0.06;
bankservicefees = (10+total);
cout<<"Total bank service fees for the month is $" <<bankservicefees<<endl;
}
}
if(checks >= 40 && checks <=59)
{
if(beginningbalance < 400)
{
total = checks*0.06;
bankservicefees = (10+total+15);
cout<<"Total bank service fees for the month is $" <<bankservicefees<<endl;
}
}
if(checks >= 60 && beginningbalance > 400)
{
total = checks*0.04;
bankservicefees = (10+total);
cout<<"Total bank service fees for the month is $" <<bankservicefees<<endl;
}
if(checks >= 60 && beginningbalance < 400)
{
total = checks*0.04;
bankservicefees = (10+total+15);
cout<<"Total bank service fees for the month is $"<<bankservicefees<<endl;
}
//pause system for a while
system("pause");
}//End main function
Output:
Enter beginning balance
300
Enter number of checks written on this month
20
Total bank service fees for the month is $26.6
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.