question archive Write a checkbook balancing program

Write a checkbook balancing program

Subject:Computer SciencePrice:7.87 Bought7

Write a checkbook balancing program. The program will read in the following information for all checks that were not cashed as of the last time the user balanced their checkbook:

  • the number of each check

  • the amount of the check

  • whether or not the check has yet been cashed

Use a dynamic array with a class base type for the checks.

The checkclass should have three member variables:

  • check number

  • check amount

  • whether or not the check's been cashed

And don't forget to provide accessors, mutators, and constructors as well as input and output methods.

BTW, the amountmember variable will be of type Money. Just save this link to the Moneyclass definition — you do not have to designit yourself!

(A closer look, however, reveals that it is just a class definition... The definitions for the methods seem to be missing. Bummer...)

In addition to all of the checks since the last checkbook update, your program should also read all of the user's deposits, the last balance we reported to them, and the new balance the bank reported to them. You will most likely desire a second [dynamic] array to hold all of the deposits. (A deposit is, of course, a Moneytype value.)

Your program should calculate and print the total for all checks, the total for all deposits, the calculated new balance, and how much this differs from the reported new balance. (Just in case: the new account balance should be the old balance plus all deposits and minus all cashedchecks.)

Then display two lists of checks: those already cashed and those still not cashed. Sort each list from lowest to highest check number. (Note that this will not require you to split the checks into twoarrays...)

To make the dynamic array management easier, you can ask the user how many checks and deposits they have to enter.

Hint: There are three sorts described in the 121 notes. One was even pseudocoded up quite nicely ...if you'd like to borrow it.

Hint: Your class should have its own library — just like the provided Moneyclass is designed to have its own library. Other libraries may also be used for collections of functions.

Note: Since your checkclass has a member variable of the class type Money, you are using compositionto build your checkclass.

Read this program description CAREFULLY! It is long and tedious. It is easy to miss essential details.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

Answer:

Program Plan:
• To define the class Money.
o Declare constructors, methods and variables in Money class.
o Define the methods in class money, overload operator for sum, subtraction, equivalence, less
than, input and output
o Define constructors for class Money.
• To define the class Check.
o Declare constructors, methods and variables in Money class.
o Define constructors for class Money.
o Define the Accessor and Mutator function for variables in class check.
o Define the methods in class check for, overload operator input and output.
• In main method,
o Declare an array of class type Check to hold check details, and another array of type double for
deposits.
o Get the account details like initial balance, deposit amounts from user.

o Calculate the effect of deposits on account balance.
o Get the check details from user. The format is important.
o Calculate the effect of checks on account balance. Also calculate total of deposits and checks
amount.
o Sort the two vectors containing list of cashed and uncashed checks.
o Display all the calculated values and list of cashed and uncashed checks.

Program:

Please see the attached file below:

https://drive.google.com/file/d/1USEI7tfayRbH7oVKxTXtbNFXguOEzPZc/view?usp=sharing

Related Questions