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 20-39 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 moth, then computers and displays the bank's fees for the month

in a C++

A software company sells a package that retails for $99.Quantity discounts are given according to the following table:

#include<iostream>

#include<iomanip> // manipulator

using namespace std;
void main ()
{
bool number = true; // flag
int Nchecks; // number of ticket
float Obalance, // opening balance
Cfee, // checking fee
Cbalance; // closing balance
const float Mfee=10, // monthly fee
Exfee=15; // extra fee

cout << "Enter your beginning balance: ";
cin >> Obalance;
cout << endl << "Enter your number of check written:";
cin >> Nchecks;
cout << endl << endl << "Bank Statement" << endl<<endl;

if ( Nchecks < 0 ) // flag statement
{
number = false;
cout << "Invalid number" << endl;
cout << "Input the number greater than 0" << endl;
}

else if ( Nchecks>=0&&Nchecks< 20 ) // else if statements
Cfee = 10;
else if ( Nchecks>=20&&Nchecks<=39)
Cfee = 8;
else if ( Nchecks>=40&&Nchecks<=59)
Cfee = 6;
else if ( Nchecks>=60)
Cfee = 4;

Cbalance = Obalance + Mfee + Cfee; // calculation

if ( Obalance < 400) // case of under 400
{
if ( Nchecks>=0&&Nchecks< 20 )
Cfee = 10;
else if ( Nchecks>=20&&Nchecks<=39)
Cfee = 8;
else if ( Nchecks>=40&&Nchecks<=59)
Cfee = 6;
else if ( Nchecks>=60)
Cfee = 4;

Cbalance=Obalance + Mfee + Cfee + Exfee;
}

if ( number ) // for true flag
{
cout<<setprecision(2)<<setiosflags(ios::fixed|ios::showpoint);
cout<<"Opening Balance:"<<setw(14)<<"$"<<setw(10)<<Obalance<< endl;
cout<<"Monthly Fee:"<<setw(18)<<"$"<<setw(10)<<Mfee<<endl;
cout<<"Checking Fee:"<<setw(17)<<"$"<<setw(10)<<Cfee<<endl;
cout<<"Closing Balance:"<<setw(14)<<"$"<<setw(10)<<Cbalance<<endl;
}

}

here is one way hope it helps!

#include <iostream>

using namespace std;


int main()
{


double checks;
int monthBankCharge = 10;
cout << "Enter the amount of checks you've written in the past month\n";

cin >> checks;

if (checks < 20)
{ cout << checks * 0.10 << endl;}

else if (checks >= 20)
{ cout << checks* 0.08 << endl;}

else if (checks >= 40)
{ cout << checks * 0.06 << endl;}

else if (checks >= 60)
{ cout << checks * 0.04 << endl;}



system("pause");
return 0;

Sure! Here's a C++ program that asks the user for the number of checks written during the past month and then computes and displays the bank's fees for the month:

```cpp
#include <iostream>

int main() {
int numChecks;
double fee = 10.0; // base fee of $10 per month

// Get the number of checks from the user
std::cout << "Enter the number of checks written during the past month: ";
std::cin >> numChecks;

// Calculate the fees based on the number of checks
if (numChecks < 20) {
fee += numChecks * 0.10;
} else if (numChecks >= 20 && numChecks < 40) {
fee += numChecks * 0.08;
} else if (numChecks >= 40 && numChecks < 60) {
fee += numChecks * 0.06;
} else {
fee += numChecks * 0.04;
}

// Display the total fees for the month
std::cout << "Total fees for the month: $" << fee << std::endl;

return 0;
}
```

Explanation:

1. The program starts by including the necessary library, `iostream`, which allows input and output operations.

2. In the `main()` function, we declare the variables: `numChecks` to store the number of checks, and `fee` to store the total fees, which is initialized to the base fee of $10 per month.

3. The user is prompted to enter the number of checks written in the past month using `std::cout` and `std::cin` to display and read the input from the user, respectively.

4. Next, we use an if-else if-else ladder to calculate the fees based on the number of checks written. The conditions check which range the number of checks falls into and adjust the fee accordingly. We multiply the number of checks in each range by the respective fee per check.

5. Finally, the program displays the total fees for the month using `std::cout`.

6. The program ends by returning 0 from the `main()` function.

You can compile and run this program to calculate the bank's fees based on the number of checks written.