Question: Please help me out with this. Thank you. Source: https://github.com/Seneca-244200/OOP-Workshops/tree/main/WS03 DIY (50%) Account Balance Interest Report Seneca Bank creates a daily report of the credit
Please help me out with this. Thank you.
Source: https://github.com/Seneca-244200/OOP-Workshops/tree/main/WS03
DIY (50%) Account Balance Interest Report
Seneca Bank creates a daily report of the credit card accounts and the time of their last payment in days in following format:
Account Number comma Balance comma Days passed since the last payment newline Example:
97988775,852283.02,6 90837261,1776257.40,14 96925213,471948.98,56 97687611,849206.85,47 90251542,878439.19,9 99792020,432107.95,55 99456993,1676602.38,52 91668387,1980439.23,53 97717004,853368.22,8 90862850,1264645.87,30 99493936,37329.10,58 93182966,1742978.32,54 94523817,161271.42,23 96829419,363081.73,43 94222780,323362.90,21 Your task for this part is to create the modules required to provide functionalities for other programmers to create on-screen reports of:
- All the accounts, their balance and days since their last payment and the Interest Charges
---------------------------------------- >>> Seneca Bank & Trust <<< ---------------------------------------- Row Accnt No Balance Days Interest --- ---------- ------------ ---- -------- 1 97988775 852283.02 6 2 90837261 1776257.40 14 3 96925213 471948.98 56 20636.45 4 97687611 849206.85 47 31164.73 5 90251542 878439.19 9 6 99792020 432107.95 55 18556.96 7 99456993 1676602.38 52 68074.65 8 91668387 1980439.23 53 81957.63 9 97717004 853368.22 8 10 90862850 1264645.87 30 11 99493936 37329.10 58 1690.55 12 93182966 1742978.32 54 73491.61 13 94523817 161271.42 23 14 96829419 363081.73 43 12190.59 15 94222780 323362.90 21 ----------------------------------------- Total interest: 307763.17 - All the accounts that their payment is past due with interest.
INTEREST ONLY LIST! ---------------------------------------- >>> Seneca Bank & Trust <<< ---------------------------------------- Row Accnt No Balance Days Interest --- ---------- ------------ ---- -------- 1 96925213 471948.98 56 20636.45 2 97687611 849206.85 47 31164.73 3 99792020 432107.95 55 18556.96 4 99456993 1676602.38 52 68074.65 5 91668387 1980439.23 53 81957.63 6 99493936 37329.10 58 1690.55 7 93182966 1742978.32 54 73491.61 8 96829419 363081.73 43 12190.59 ----------------------------------------- Total interest: 307763.17 Implementation
To accomplish this we suggest the creation of two modules (classes); the Account and the Bank.
The Account should hold a single record of the credit card payment record in the report file.
The Bank should hold a dynamically allocated array of Accounts and provide the required reports.
Note: Reading and accessing the data file and populating the modules are done by the tester program. You are not implementing any file-related code.
You may freely use/copy any logic or code needed from the LAB section!
Constant values,
- The Interest-free payment period is always 30 days.
- The Interest rate is always 28.5% annually.
Any account that is not paid in full within 30 days will be charged by an interest based on the full amount and the total number of days.
For example, if an account's balance is 1000 Dollars and the days since the last payment is less than or equal to 30 days, no interest will be charged. But if an account's last payment was 31 days ago, then an interest of
NoOfDays x (InterestRate/NumberOfDaysInAYear) x AccountBalance which in this example will be 31 x (0.285/365) x 1000, will be charged (approximately 24 Dollars 20 Cents).
Mandatory publicly accessible methods of Bank Module
You must have the following public methods available in the Bank class.
void initialize(const char* bank_name, int noOfAccounts);
If the bank_name is not null and it is not an empty Cstring and also the noOfAccouts is greater than zero, this function will store the name of the bank and the number of accounts the Bank can dynamically hold. It will also set all other possible properties to thier default values.
Otherwise, it will set the bank into a safe invalid empty state.
bool addAccount(int account_number, double balance, int daysSinceLastPayment);
This function will insert the account information into the next available Account record in the Bank. The function should fail and return false if the Bank accounts are full or if any of the information is invalid (i.e. if any of the arguments have a value less than or equal to zero)
void display(bool intrestOnly=false)const;
Displays the accounts in the Bank as shown in the examples above.
void clear();
Released the memory allocated by the Bank Class.
The tester program
// Workshop #3: // Version: 0.9 // Date: 2021/09/26 // Author: Fardad Soleimanloo // Description: // This file tests the DIY section of your workshop /////////////////////////////////////////////////// #define _CRT_SECURE_NO_WARNINGS #include
Invalid Bank Invalid Bank Invalid Bank Invalid Bank ---------------------------------------- >>> Seneca Bank & Trust <<< ---------------------------------------- Row Accnt No Balance Days Interest --- ---------- ------------ ---- -------- 1 97988775 852283.02 6 2 90837261 1776257.40 14 3 96925213 471948.98 56 20636.45 4 97687611 849206.85 47 31164.73 5 90251542 878439.19 9 6 99792020 432107.95 55 18556.96 7 99456993 1676602.38 52 68074.65 8 91668387 1980439.23 53 81957.63 9 97717004 853368.22 8 10 90862850 1264645.87 30 11 99493936 37329.10 58 1690.55 12 93182966 1742978.32 54 73491.61 13 94523817 161271.42 23 14 96829419 363081.73 43 12190.59 15 94222780 323362.90 21 ----------------------------------------- Total interest: 307763.17 INTEREST ONLY LIST! ---------------------------------------- >>> Seneca Bank & Trust <<< ---------------------------------------- Row Accnt No Balance Days Interest --- ---------- ------------ ---- -------- 1 96925213 471948.98 56 20636.45 2 97687611 849206.85 47 31164.73 3 99792020 432107.95 55 18556.96 4 99456993 1676602.38 52 68074.65 5 91668387 1980439.23 53 81957.63 6 99493936 37329.10 58 1690.55 7 93182966 1742978.32 54 73491.61 8 96829419 363081.73 43 12190.59 ----------------------------------------- Total interest: 307763.17 DIY Submission (part 2)
Files to submit:
Account.cpp Account.h Bank.cpp Bank.h WS3P2Tester.cpp accounts.csv
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
