CSC Lab 7 30 points Part 1 due April 14th This project is to create a banb_acct class and then an inherited check_acct. It also requires you to use vectors. Arrays will not be acceptable. The first...

Computer Science


CSC Lab 7 30 points Part 1 due April 14th This project is to create a banb_acct class and then an inherited check_acct. It also requires you to use vectors. Arrays will not be acceptable. The first part is done in the lab and is the definition of the base class and some structures needed for it. STEP 1: Define a struct called transaction which has an amount that is double, a date in the form yyyymmdd and a type which is either “W’ for withdrawal or ‘D’ for deposit. Define a struct called a_balance which has a date and a balance. This will represent the starting balance on that date. STEP 2: Create a classs bank_acct Fields: balance which is a double (initialize to 0) acct_num which is a string vector of transactions vector of a_balance We need a generic constructor. There must be a get_balance and a get_acct_num. There must be a set_balance and a set_acct_num. There must be a get_number_of_transactions. There must be methods Void deposit(double amount) which adds amount to the balance and records the transaction. bool withdrawal(double amount) which attempts to withdraw amount. If the balance is insufficient, the method returns false, else it returns true. If the withdrawal is done, the method records the transaction. Print (int n) which prints the last n transactions in a table. Each row of the table has the date, the type of the transaction, the amount of the transaction and the balance after the transaction. These are ordered by date. Printall(int date) which prints all transactions since the date. The form should be the same as above. STEP 3: Create a struct check which has date of the check, check_number, the payee and amount of the check. STEP 4: Create a derived class Check_acc with a vector of cashed checks and a type. Type = ‘O’ allows overdrafts. Type = ‘N’ allows no overdrafts. Each month, the checking account allows 4 free checks. After these four, there is a 0.75 charge per check which must be deducted from the balance. If the type is ‘O’, a check can be paid even if there are insufficient funds but there is a $20 fee. Each month, a fee of $5 is deducted from the balance on the last day of the month. If there are insufficient funds, another fee of $10 is deducted. Remember that fees are withdrawal transactions and their type must be ‘F’ or ‘I’. Use ‘I’ for the insufficient penalties. This class must have a method which attempts to cash checks. It returns false if the check cannot be cashed and true otherwise. If it cashes the check, it enters the transaction in the transaction vector as well as adding the check to the check vector. The type of the transaction is ‘C’. It must also have a method which creates a monthly statement on the last day of the month. The statement has the following: It will print the opening balance for the month. It will print the list of transactions for the month and the balance after each transaction. This portion can use the inherited print(n). It will print the closing balance. It will print a separate section which has the checks including the check number, amount and payee.
Apr 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here