Answer with flow chart please 1. A bank charges $10 per month plus the following
ID: 669506 • Letter: A
Question
Answer with flow chart please
1. A bank charges $10 per month plus the following check fees for a commercial checking account:
$.10 each for less 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). Design 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.
2. The Fast Freight Shipping Company charges the following rates:
Weight of Package (in kilograms) Rate Per 500 Miles Shipped
2 Kg or less $1.10
Over 2 Kg but not more than 6 Kg $2.20
Over 6 Kg but not more than 10 Kg $3.70
Over 10 Kg but not more than 20 Kg $4.80
Design a program that asks for the weight of the package and the distance it is to be shipped, and then displays the charges.
Explanation / Answer
1.
#include <iostream>
using namespace std;
double charges(int n){
if (n < 20)
return n*0.1;
else if (n >= 20 && n < 40)
return n*0.08;
else if (n >= 40 && n < 59)
return n*0.06;
return n*0.04;
}
int main(){
double balance;
cout << "Enter Your Bank Balance : ";
cin >> balance;
int checks;
cout << "Enter number of checks written : ";
cin >> checks;
double charges = amount(checks);
if (balance < 400.0)
charges += 15;
// Monthly Charges
charges += 10;
cout << "Bank Service fee for the month is : " << charges << endl;
return 0;
}
2.
#include <iostream>
using namespace std;
double cal(w,d){
if (w <= 2) return d*1.10;
else if (w > 2 && k <= 6) return d*2.20;
else if (w > 6 && k <= 10) return d*3.70;
else if (w > 10 && k <= 20) return d*4.80;
}
int main(){
double weight,distance;
while (true){
cout << "Enter weight of the package : ";
cin >> weight;
if (weight > 20)
cout << "Weight must be less than 20 Kg, choose again " << endl;
}
cout << "Enter distance it is to be shipped : ";
cin >> distance;
cout << "Total charges : " << cal(weight,distance) << endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.