Bank Charges, help is needed

need help..can someone check out my program and give me advice please






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
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 what i have so far but i dont know if i even did it right. can someone help me please and thank you

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  float beg_balance = 0, checks_wrtn = 0;
    const int fee = 15;
    float minimum = 400, chargePerCheck = 0;
    
    
    cout << "There is a payment of $10 per month\n";
    cout << " for this account";
    cout << "what is your balance and how many\n";
    cout << "checks have you written?";
    cin >> beg_balance >> checks_wrtn;
    
    if ( beg_balance < 400)
    {
        beg_balance += fee; 
        cout << "sorry there is a fee of $15\n";
        cout << "if you have a balance that is \n";
        cout << "below $400\n\n";
        cout << "your current balance is " << beg_balance << endl;
            
    }
    else if ( beg_balance >= 400 )
    {
        cout << "you current balance is "<< beg_balance<< endl;
    }
    
    
    if ( checks_wrtn < 20)
    {
        chargePerCheck += .10;
        cout << "there is a charge of 10 cents\n";
        cout << "for checks that are 20 or less";
    }
    else if ( checks_wrtn > 20 && checks_wrtn < 39)
    {
        chargePerCheck += .08;
        cout << "there is a charge of 8 cents for\n"
             << " 20 to 39 written checks";
        
        
    }
    else if ( checks_wrtn > 40 && checks_wrtn < 59)
    {
chargePerCheck += .06;
        cout << "there is a charge of 6 cents for\n"
             << "  40 to 59 written checks";
    }
    
    
    
Last edited on
lol kinda odd to not know if you did it right but i ran your program and it seems legit. I think you need to better format your cout messages though, doesnt look neat on screen.
Last edited on
well i just wanted to see if there was a shorter way to code this program cause it seems to long
Topic archived. No new replies allowed.