TCSS 143 A Programming Assignment 2 Due: May 13th 2023, 11:59 PM on Canvas NOTE: Be...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
TCSS 143 A Programming Assignment 2 Due: May 13th 2023, 11:59 PM on Canvas NOTE: Be sure to adhere to the University's Policy on Academic Integrity. Programming assignments are to be written individually and submitted programs must be the result of your own efforts. Any suspicion of academic integrity violation will be dealt with accordingly. Purpose: This programming assignment will evaluate your understanding of concepts of inheritance, abstraction, and lists. Goals: Successful completion of the assignment means that the student can implement a program with interfaces, abstract classes, and classes. This assignment is aimed towards the following learning outcomes: Understand the requirements from different sources: end-user and developer Model real-world scenarios using simple inheritance and class designs . • Code simple methods (with 1-10 lines of code) • Handle edge cases and exceptions Evaluation Scheme: The assignment is for 100 points and the rubric for evaluation is Criteria Points Correct files and file names submitted 1 Code compiles successfully 10 Documentation: Code has comments - Javadoc, single line, and multi-line comments 5 Programming notations and rules followed 2 Correct Implementation 60 Program generates expected output 10 UML 5 Client program (Main method) to demonstrate the prototype 7 Submission guidelines: You need to submit a zip file named <yourname>_PA2.zip. The zip will consist of • Source code - 7 java files + 1 java file for Bonus о Document - Javadoc files and UML diagram. Please mention your IDE and Java version in the class level Javadoc comments 1 Problem Description: TownX Inc. reviewed your prototype of e-LMS and has decided to hire you to develop the banking software for one of its new financial establishments. You need to deliver a working prototype based on the preliminary requirements - • • • • • • Provision of banking accounts. Each banking account is identified by account id, the amount in the account and the type of account. A bank customer can open any of the two types of accounts - Checking account and Savings account. An account can be opened with minimum amount only. The bank plans to open other types of savings accounts too, and now provides only Regular Savings account. Each savings account type also maintains the savings rate for the given account type. A bank customer can hold multiple accounts. Each bank account provides withdrawal and deposit operations on the account. These operations depend on the type of account. Every customer can additionally perform the following operations - open an account, close an account, make a transaction on the account, get report of the accounts that customer holds, all the transactions made, and all the transactions made given the account. • Every transaction holds the information - account id, amount, whether the transaction is credit or debit. Your team lead has provided you the technical specifications¹ (a part of the SRS - software requirements specification) with design of required classes. You are required to meet the specific outputs for given Test Cases. Create a package tcss143. Banking. This should include the classes in Step 1 and 2. It is upto you to decide if you want to create further packages for step 1 and step 2, but you would have to handle the encapsulated fields. Step 1: Model Bank Account 1. Model the abstract concept of bank account. a. Implement an abstract class BankAccount with account id of type String, type of account of data type String and the amount that the account currently holds (prefer double datatype). Make sure these fields are encapsulated such that they can be inherited but remain private to the super and subclasses. b. The type of account for now are defined as - "checking" and "saving”. (You are free to use String or Enum type) c. Implement constructor that accepts all the above three fields. d. Implement the getters and setters so that client can access encapsulated fields. 1 These specifications have been simplified and are imaginary. None of these reflect the real world scenario or implementations. 2 e. Override toString() method from the Object superclass. The format of output should be - Eg: "checking $5.00″. f. The abstract methods are: withdraw () and deposit () that accept the amount of type double and return nothing. 2. Model the abstract concept of Savings account (Note: We have this as abstract class because, as per end-user requirements, there are plans to provision various types of savings account. So, a customer cannot directly own a savings account, but its specific type. Even though we have only one type of savings account, as a software designer you need to provide provisions for extendibility of requirements and code to make it easy for maintenance) a. Implement an abstract class Savings Account that inherits the concept of bank account and maintains savings rate of type double which is encapsulated and can be inherited. b. Implement constructor for the inherited class which passes a constant value for the type of account - "saving". c. Implement getter for the field(s). d. Implement the withdraw() method. The logic is to deduct given amount from the amount in the bank (bank amount = bank amount - amount). Make sure to handle the cases with "Insufficient Balance". Use exceptions. 3. Create class named CheckingAccount that inherits the abstract concept of banking account. a. Implement constructor for the inherited class which passes a constant value for the type of account - "checking". b. Implement the inherited abstract methods. Use the logic in 2.d. For deposit(), the logic is to add given amount to the amount in the bank (bank amount = bank amount + amount) 4. Create class named RegularSavings Account that inherits Savings Account. a. Implement constructor for the inherited class and sets the savings rate to 0.01. b. Implement the abstract method for deposit, the logic for which is : bank amount bank amount + amount + amount * savings rate. Note: a. Handle exceptions whenever required or necessary. You can create custom messages for exceptions (throw new Exception ("This is example");). Use your judgement to decide on what type of exceptions are required (Eg: Runtime exception, etc) b. Use @Override annotation above each method that you override in subclasses. Though there are no points allotted for this. c. Hint: Observe the above classes and see where you can use super([params]) for the constructors without need for any additional statements. d. You can use enum if you want to do so. 3 Step 2: Model Bank Customer 1. The state and behavior of the bank customer entity is modelled using 2 classes and 1 interface. 2. Create a class Transaction to model the transactions that happens (Note: It is common to have such classes and even with only one logic or purpose - Refer to term POJOS (Plain Old Java objects)) a. There are three encapsulated fields - account ID, amount of the transaction and the type of transaction (it is credit or debit) b. Implement a constructor that will accept all th encapsulated fields. c. Implement getters and setters for all the fields. d. Override the toString() method (You are free to choose the format, but it should represent all the fields) 3. Create a class BankCustomer should hold three encapsulated fields i. Name of the customer ii. List of all bank accounts (Make use of polymorphism so that a the list can hold multiple type of accounts for a customer) iii. List of all transactions made iv. Implement all the methods in the interface below. Hint: Use List of objects. 4. Create an interface named AccountActions that abstracts the following methods a. openAccount ([accountID, amount, typeOfAccount]): creates the given type of account with given ID and amount for the customer. b. closeAccount([accountID]): closes the give account for the customer c. makeTransaction([accountID,amount, typeOfTransaction]): typeOfTransaction is credit or debit, creates a transaction type for each account and stores them. d. printTransaction Report ([accountID]): prints all the transactions made by the customer under the given accountID. e. printTransactionReport() : prints all the transactions that customer has made (note this is for all the accounts) f. printAllAccounts(): prints the list of all accounts the customer holds (Hint: use toString()) Step 3: Documentation Generate UML diagram: You can draw the diagram using UML software freely available (eg. draw.io), you can use PowerPoint too. If you know how to generate your UML diagrams in IDE, it is recommended to do so. Please see (https://developer.ibm.com/articles/the-class-diagram/) Create html for Javadoc for the package. 4 Step 4: Implement your own client program in another package tcss143.bankclient. Create two customers - Alice and Bob. (2 points) Demonstrate opening and closing of accounts and print methods for these customers. Create another customer - Charlie (5 points) о Create a prompt-based menu for the customer. The options should be "Select: 1. Make Transaction 2. Print Transactions for Account 3. Print all transactions 4. Print all accounts 5. Exit" о Use the above menu to check all the operations defined in the interface and demonstrate the various edge cases and exceptional cases. TCSS 143 A Programming Assignment 2 Due: May 13th 2023, 11:59 PM on Canvas NOTE: Be sure to adhere to the University's Policy on Academic Integrity. Programming assignments are to be written individually and submitted programs must be the result of your own efforts. Any suspicion of academic integrity violation will be dealt with accordingly. Purpose: This programming assignment will evaluate your understanding of concepts of inheritance, abstraction, and lists. Goals: Successful completion of the assignment means that the student can implement a program with interfaces, abstract classes, and classes. This assignment is aimed towards the following learning outcomes: Understand the requirements from different sources: end-user and developer Model real-world scenarios using simple inheritance and class designs . • Code simple methods (with 1-10 lines of code) • Handle edge cases and exceptions Evaluation Scheme: The assignment is for 100 points and the rubric for evaluation is Criteria Points Correct files and file names submitted 1 Code compiles successfully 10 Documentation: Code has comments - Javadoc, single line, and multi-line comments 5 Programming notations and rules followed 2 Correct Implementation 60 Program generates expected output 10 UML 5 Client program (Main method) to demonstrate the prototype 7 Submission guidelines: You need to submit a zip file named <yourname>_PA2.zip. The zip will consist of • Source code - 7 java files + 1 java file for Bonus о Document - Javadoc files and UML diagram. Please mention your IDE and Java version in the class level Javadoc comments 1 Problem Description: TownX Inc. reviewed your prototype of e-LMS and has decided to hire you to develop the banking software for one of its new financial establishments. You need to deliver a working prototype based on the preliminary requirements - • • • • • • Provision of banking accounts. Each banking account is identified by account id, the amount in the account and the type of account. A bank customer can open any of the two types of accounts - Checking account and Savings account. An account can be opened with minimum amount only. The bank plans to open other types of savings accounts too, and now provides only Regular Savings account. Each savings account type also maintains the savings rate for the given account type. A bank customer can hold multiple accounts. Each bank account provides withdrawal and deposit operations on the account. These operations depend on the type of account. Every customer can additionally perform the following operations - open an account, close an account, make a transaction on the account, get report of the accounts that customer holds, all the transactions made, and all the transactions made given the account. • Every transaction holds the information - account id, amount, whether the transaction is credit or debit. Your team lead has provided you the technical specifications¹ (a part of the SRS - software requirements specification) with design of required classes. You are required to meet the specific outputs for given Test Cases. Create a package tcss143. Banking. This should include the classes in Step 1 and 2. It is upto you to decide if you want to create further packages for step 1 and step 2, but you would have to handle the encapsulated fields. Step 1: Model Bank Account 1. Model the abstract concept of bank account. a. Implement an abstract class BankAccount with account id of type String, type of account of data type String and the amount that the account currently holds (prefer double datatype). Make sure these fields are encapsulated such that they can be inherited but remain private to the super and subclasses. b. The type of account for now are defined as - "checking" and "saving”. (You are free to use String or Enum type) c. Implement constructor that accepts all the above three fields. d. Implement the getters and setters so that client can access encapsulated fields. 1 These specifications have been simplified and are imaginary. None of these reflect the real world scenario or implementations. 2 e. Override toString() method from the Object superclass. The format of output should be - Eg: "checking $5.00″. f. The abstract methods are: withdraw () and deposit () that accept the amount of type double and return nothing. 2. Model the abstract concept of Savings account (Note: We have this as abstract class because, as per end-user requirements, there are plans to provision various types of savings account. So, a customer cannot directly own a savings account, but its specific type. Even though we have only one type of savings account, as a software designer you need to provide provisions for extendibility of requirements and code to make it easy for maintenance) a. Implement an abstract class Savings Account that inherits the concept of bank account and maintains savings rate of type double which is encapsulated and can be inherited. b. Implement constructor for the inherited class which passes a constant value for the type of account - "saving". c. Implement getter for the field(s). d. Implement the withdraw() method. The logic is to deduct given amount from the amount in the bank (bank amount = bank amount - amount). Make sure to handle the cases with "Insufficient Balance". Use exceptions. 3. Create class named CheckingAccount that inherits the abstract concept of banking account. a. Implement constructor for the inherited class which passes a constant value for the type of account - "checking". b. Implement the inherited abstract methods. Use the logic in 2.d. For deposit(), the logic is to add given amount to the amount in the bank (bank amount = bank amount + amount) 4. Create class named RegularSavings Account that inherits Savings Account. a. Implement constructor for the inherited class and sets the savings rate to 0.01. b. Implement the abstract method for deposit, the logic for which is : bank amount bank amount + amount + amount * savings rate. Note: a. Handle exceptions whenever required or necessary. You can create custom messages for exceptions (throw new Exception ("This is example");). Use your judgement to decide on what type of exceptions are required (Eg: Runtime exception, etc) b. Use @Override annotation above each method that you override in subclasses. Though there are no points allotted for this. c. Hint: Observe the above classes and see where you can use super([params]) for the constructors without need for any additional statements. d. You can use enum if you want to do so. 3 Step 2: Model Bank Customer 1. The state and behavior of the bank customer entity is modelled using 2 classes and 1 interface. 2. Create a class Transaction to model the transactions that happens (Note: It is common to have such classes and even with only one logic or purpose - Refer to term POJOS (Plain Old Java objects)) a. There are three encapsulated fields - account ID, amount of the transaction and the type of transaction (it is credit or debit) b. Implement a constructor that will accept all th encapsulated fields. c. Implement getters and setters for all the fields. d. Override the toString() method (You are free to choose the format, but it should represent all the fields) 3. Create a class BankCustomer should hold three encapsulated fields i. Name of the customer ii. List of all bank accounts (Make use of polymorphism so that a the list can hold multiple type of accounts for a customer) iii. List of all transactions made iv. Implement all the methods in the interface below. Hint: Use List of objects. 4. Create an interface named AccountActions that abstracts the following methods a. openAccount ([accountID, amount, typeOfAccount]): creates the given type of account with given ID and amount for the customer. b. closeAccount([accountID]): closes the give account for the customer c. makeTransaction([accountID,amount, typeOfTransaction]): typeOfTransaction is credit or debit, creates a transaction type for each account and stores them. d. printTransaction Report ([accountID]): prints all the transactions made by the customer under the given accountID. e. printTransactionReport() : prints all the transactions that customer has made (note this is for all the accounts) f. printAllAccounts(): prints the list of all accounts the customer holds (Hint: use toString()) Step 3: Documentation Generate UML diagram: You can draw the diagram using UML software freely available (eg. draw.io), you can use PowerPoint too. If you know how to generate your UML diagrams in IDE, it is recommended to do so. Please see (https://developer.ibm.com/articles/the-class-diagram/) Create html for Javadoc for the package. 4 Step 4: Implement your own client program in another package tcss143.bankclient. Create two customers - Alice and Bob. (2 points) Demonstrate opening and closing of accounts and print methods for these customers. Create another customer - Charlie (5 points) о Create a prompt-based menu for the customer. The options should be "Select: 1. Make Transaction 2. Print Transactions for Account 3. Print all transactions 4. Print all accounts 5. Exit" о Use the above menu to check all the operations defined in the interface and demonstrate the various edge cases and exceptional cases.
Expert Answer:
Answer rating: 100% (QA)
Heres a basic implementation of the classes based on the provided requirements package tcss143bankin... View the full answer
Related Book For
Auditing and Assurance services an integrated approach
ISBN: 978-0132575959
14th Edition
Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley
Posted Date:
Students also viewed these programming questions
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
(1) Choose all of the following statements that are correct about the time evolution of a general wave function: (I) The time evolution of a general wave function is governed by the Hamiltonian...
-
A crate is given an initial speed of 3.0m/s up the 25.0 plane shown in Fig. 4-60. (a) How far up the plane will it go? (b) How much time elapses before it returns to its starting point? Assume k =...
-
Using a process simulator, make the following modifications to the C6C7C8 example in 13.7: (a) Increase the reflux above 8 to eliminate the second intermediate cut. (b) Change the termination...
-
Tyler Company reported the following costs on its financial statements (in thousands): REQUIRED: Using the reserve disclosure for Tyler Company in problem 13 and the data presented in this problem,...
-
Benton Corporation produces two grades of wine from grapes that it buys from California growers. It produces and sells roughly 3,000,000 liters per year of a low-cost, high-volume product called...
-
1. An object of mass of 4 kg is resting at a height of 2 m and then falls to the ground. a. Model the energy of the object-Earth system with Energy Bar Charts when at the initial height and ground...
-
Lavare, located in the Chicago suburbs, is a major manufacturer of stainless steel sinks. Lavare is in the middle of the demand and supply planning exercise for the coming year. Anticipated monthly...
-
Using the weighted-average method of process costing, complete each of the following steps: a. Reconcile the number of physical units worked on during the period. b. Calculate the number of...
-
A taxpayer acquired a building for use in a business on January 1, Year 2. On July 1, Year 3, the building was severely damaged by a storm. The taxpayer elected to treat the damage to the building as...
-
1The interest rate charged on overnight loans of reserves between banks is the _____ Question 10Select one: a. treasury bill rate. b. federal funds rate c. discount rate d. prime rate
-
Under what circumstances is it OK for a product owner to substitute one user story for another one during a sprint? 1. When the team unanimously agrees during a daily scrum 2. When the product owner...
-
Two mutually exclusive projects, M and N, have the same payback periods but M has a higher net present value NPV. What conclusion can be drawn about the projects? Question 9Answer a. Project M is...
-
There are circumstances where the QLD WHS Act & Regulation 2011, do not have jurisdiction? Identify the Act that applies to the identified activity using the table below (Ensure you cite the Act...
-
You have signed a contract to supply a chemical compound to a company. This compound costs you $32.50/gallon and generates a contribution of $12.50/gallon. Delivery costs you $175 in shipping and...
-
Data 9.2 on page 540 introduces the dataset Cereal, which includes information on the number of grams of fiber in a serving for 30 different breakfast cereals. The cereals come from three different...
-
Define what is meant by a tick mark. What is its purpose?
-
For each engagement described below, indicate whether the engagement is likely to be conducted under international auditing standards, U.S. generally accepted auditing standards, or PCAOB auditing...
-
Items 1 through 6 are common questions found in internal control questionnaires used by auditors to obtain an understanding of internal control for owners' equity. In using the questionnaire for a...
-
Using the tools provided to you in this chapter, conduct a comprehensive review one of the websites listed below. Is it a reliable resource without underlying motivations? MinimumWage.com ...
-
Research and find at least three reports of fabricated or misleading news causing damage to a company or organization. Consider how the news was created and disseminated. What could have been done,...
-
What are the strategies for effective secondary research searches?
Study smarter with the SolutionInn App