The question is attached. Please submit the project file in Dev or Visual C++ 2010.
CS111 Project #1 CS112, USP – Assign_2, S22020 Page 1 of 10 Dinesh Kumar The University of the South Pacific School of Computing, Information & Mathematical Sciences CS112: Data Structures and Algorithms Semester II, 2020 Assignment #2 Learning Outcome: Develop data structures using object-oriented programming. Due Date: Friday 23rd October 2020 @ 5pm (Fiji Standard Time) Submission: - This assignment is to be done in pairs (group of two students) – same team as in Assignment 1. - Submit the completed C++ program file via the Moodle Assignment 1 Drop box. Weight: 15% Preferred IDE: Dev C++ / Visual C++ 2010 Express Marking Rubric: CBOK Unsatisfactory (0% -49% ) Satisfactory (50% - 75% ) Good (76% - 100% ) Score Programming I. Plagiarism II. Poor indentation, hard to read and follow the code III. Lots of bugs and/or errors IV. Program produces unexpected output V. Hard coding of data in the program. VI. Poor structure I. Able to write a simple code for a well-defined problem II. Use of basic standard programming practices such as commenting, indentation etc. III. computer program produces correct output I. All satisfactory and demonstrate very good programming skills. Abstraction I. Incorrect algorithms or program logic. I. Partially correct algorithm or program logic. I. Correct algorithms or program logic. Data and Information Management I. Data is not stored and managed using appropriate tools/techniques. I. Data is stored and managed using some technique I. Extensive analysis is done on the collected/given data. CS112, USP – Assign_2, S22020 Page 2 of 10 Dinesh Kumar Problem: Managing Customer Records in a Bank – Revision I This assignment is based on the same case study as in Assignment 1, however with the following changes and requirements. The bank in your town has been quite successful and has experienced an expansion in its operations. In particular, a) The bank now has a lot more customers. b) There is no limit on the maximum balance that can maintained by a customer for any type of account. For Savings and Checking accounts, the calculation of service charge and interest remain the same. i.e. Every customer must maintain a minimum balance. If a customer’s balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts (see table 2 for more details). If the balance at the end of the month is equal to or above the minimum balance, the account receives interest as follows: Savings accounts receive 4% interest on current balance. Checking accounts with current balances of up to $5000 receive 3% interest; otherwise the interest is 5%. In both these cases, for interest to be awarded; current balance must be greater than or equal to the minimum balance. Account types have associated numeric values. This is indicated in the table below. The fee and interest schedule are also shown below: Table 1: Account Type Savings 1 Checking 2 Interest and service charge are calculated on current balance. Due to this expansion, the bank now maintains customer and account information in two separate files as follows: Input Files: A. Customers.txt. Customer information is now stored in a text file called Customers.txt. Details of each customer is stored in a row using the following format. Note, each value is separated by a comma. All data in the file is stored as strings. Customer#,Name,Address,Phone Customer# Each customer has a unique customer number. Name Name of customer. Comprises of the firstname followed by lastname. Assume, authors will have firstname and lastname (and no middle name). Table 2: Service Charge Savings A/c Checking A/c current bal < minimum="" bal="" $10="" $25="" current="" bal="">= minimum bal $10 or 0.5% (whichever is higher) $25 or 1.5 % (whichever is higher) Table 3: Interest Schedule Savings A/c Current bal < minimum="" bal="" no="" interest="" current="" bal="">= minimum bal 4% Checking A/c Current bal < minimum="" bal="" no="" interest="" current="" bal=""><= $5000="" 3%="" current="" bal="">= $5001 5% CS112, USP – Assign_2, S22020 Page 3 of 10 Dinesh Kumar Address Address of residence of customer Phone Customer’s phone contact Given below is an extract from Customers.txt file. 01-99999-01,Tom Kenny,20 Moon Road,999-2634 01-99999-02,Carl Ting,5 Dusty Street,679-1156 01-99999-03,Sue Dice,8 Cindrella Lane,679-2265 01-99999-04,Rusty Low,9 Fish Street,679-2233 B. Accounts.txt. Details of all customers’ accounts are stored in a text file called Accounts.txt. Unlike CustomerDB.txt file from assignment 1, Accounts.txt file contains additional information and where each value is separated by a comma. Details of each account is stored in a row using the following format. [Note: CustomerDB.txt file format from assignment 1 will no longer apply for this assignment] Account#,Customer#,Acc_Type,Min_Bal,Current_Bal Given below is an extract from Accounts.txt file. 4672,01-99999-01,1,5,5.50 8732,01-99999-02,2,150,5050.15 7987,01-99999-03,1,200,2450.45 8983,01-99999-04,1,180,3040.30 7988,01-99999-03,2,200,1050.10 As an example, customer 01-99999-03 has both Savings and Checking accounts. Note: *All records in Customers.txt and Accounts.txt file is valid. *The records are not stored in any order. It cannot be determined exactly how many customers the bank has; hence your program needs to dynamically increase the number of objects it needs to store data. Requirements: 1. This problem must be solved using classes and array of class objects. The following class diagram (Figure 1) shows the classes required for this program and their relationships. Some key attributes and methods that need to be implemented are also shown. [Note: initially the bank has maximum of 10 customer objects, which needs to be dynamically increased during program execution when number of customers exceed the maximum (See Lab 7 and 8 for details on how to dynamically increase number of class objects)] CS112, USP – Assign_2, S22020 Page 4 of 10 Dinesh Kumar SavingsAccount Customer Bank 1 CheckingAccount Account 1 1 1 1 SavingsAccount () float CalcInterest () float CalcServiceCharge () CustomerID :string FirstName :string LastName :string Address :string Phone :string CustSavingsAcc :SavingsAccount * CustCheckingAcc :CheckingAccount * Customer () void setCustomerDetails (string, string, string, string, string) void AddSavingsAccount (SavingsAccount *) void AddCheckingAccount (CheckingAccount *) string getCustID () string getFName () string getLName () string getAddress () string getPhone () SavingsAccount *getSavingsAcc (); CheckingAccount *getCheckingAcc (); void printCustDetailsWithSavingsAc () void printCustDetailsWithCheckingAc () Bank() void AddNewCustomer(Customer *) int getNumCustomers() Customer *GetCustomer(string custidkey) maxcustomers :int customers[10] :Customer * NumCustomers :int CheckingAccount () float CalcInterest () float CalcServiceCharge () Account() void setAccDetails ( int, float, float) int getAccNum () float getMinBal () float getCurrentBal () AccNumber :int (private) MinBal :float (protected) CurrBalance :float (protected) Figure 1: Class Diagram for the revised Banking System. Each class is shown using a class symbol divided into 3 sections. The first section illustrated the class name. The second section shows the class attributes and their associated datatypes. All attributes need to be declared as private unless stated as protected. The third section lists all the methods of the class and their parameters. CS112, USP – Assign_2, S22020 Page 5 of 10 Dinesh Kumar The description of member functions in each class are described as follows: Class: Account Account() Constructor. Sets integer attributes to 0 and float attributes to 0.0 void setAccDetails (int, float, float) Accepts 3 parameters in the order account num, minimum balance and current balance and assigns the values to the AccNumber, MinBal and CurrBalance attributes. int getAccNum () Getter function. Returns AccNumber float getMinBal () Getter function. Returns MinBal float getCurrentBal () Getter function. Returns Currbalance Class: SavingsAccount (Inherits Account class) SavingsAccount () Constructor. Since there are no attribute in this class, it is left empty with an empty statement by typing (;). float CalcInterest () Implements the formula for calculating interest on a SavingsAccount. Since this class inherits from Accounts class, it uses the attributes of the Account class to calculate interest. Finally, it returns the interest calculated. float CalcServiceCharge () Implements the formula for calculating service charge on a SavingsAccount. Since this class inherits from Accounts class, it uses the attributes of the Account class to calculate interest. Finally, it returns the service charge calculated. Class: CheckingAccount (Inherits Account class) CheckingAccount () Constructor. Since there are no attribute in this class, it is left empty with an empty statement by typing (;). float CalcInterest () Implements the formula for calculating interest on a CheckingAccount. Since this class inherits from Accounts class, it uses the attributes of the Account class to calculate interest. Finally, it returns the interest calculated. float CalcServiceCharge () Implements the formula for calculating service charge on a CheckingAccount. Since this class inherits from Accounts class, it uses the attributes of the Account class to calculate interest. Finally, it returns the service charge calculated. Class: Customer Customer () Constructor. Sets string attributes to empty string “” and pointer attributes to NULL. void setCustomerDetails (string, string, string, string, string) Accepts 5 parameters in the=>