COSC 1320 - C++ Programming and
ITSE 1307 - Introduction to C++ Programming
Bob Comer, Professor of Computer Studies


Assignment 2 - Checkbook Balancing

Read through chapter 5 before starting this assignment.

Write a C++ program to help you balance your checkbook at the end of the month. The program should have the user enter the initial balance followed by a series of transactions. For each transaction, first have the user enter a transaction type. The valid transaction types are:

For checks and deposits, the user should be prompted to enter the transaction amount.

Service Charges

Output

For each transaction, print

At the end of the month, deduct the service charges and print the final balance. Your program output should look something like this example (user input is shown in bold).

Checkbook Balancing Program

Enter the beginning balance: 900

Commands:
C - process a check
D - process a deposit
E - end the program

Enter transaction type: C
Enter transaction amount: 50.25
Processing check for $50.25
Balance: $849.75
Service charge: $.25 for a check
Total service charges: $.25

Enter transaction type: C
Enter transaction amount: 250
Processing check for $250.00
Balance: $599.75
Service charge: $0.25 for a check
Total service charges: $.50

Enter transaction type: D
Enter transaction amount: 200
Processing deposit for $200.00
Balance: $799.75
Total service charges: $.50

Enter transaction type: E
Processing end of month
Final balance: $799.25

 

Input validation

Other requirements


Return to C++ Home Page

Copyright: Ó2005 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to:
Bob Comer
Last updated: August 25, 2005