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:
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
-
Provides general specifications for 9 short array processing algorithms to be written as separate functions and tested in a single program Of course, you'll have to write a program to test each...
-
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...
-
The price of three-month and nine-month T-bills are $98.788 and $96.270, respectively. In our model of the term structure, three months from today the six-month interest rate will be either 5.5% or...
-
The feasibility of implementing your case study's environmental and social sustainability plans for XYZ Manufacturing. Addressing the questions the entire supply chain, including how the company...
-
What are the advantages and disadvantages of using RFID technology to implement the specific identification method of accounting for inventory?
-
Use the templates in Tables 4-1, 4-2, and 4-3 to recast the financial statements for Nordstrom, Inc. Cash Flow Statement Standardization Income Statement Standardization Balance Sheet Standardization...
-
1 0 . Using the data below, schedule the problem in MS Project. Display and print the schedule in a Gantt chart showing the critical path and the predecessors. WBS ACTIVITY IMMEDIATE PREDECESSOR...
-
In March 2013 the management team of Londonderry Air (LA) met to discuss a proposal to purchase five shorthaul aircraft at a total cost of $25 million. There was general enthusiasm for the...
-
Choose a leader you see as inspirational. Provide FOUR (4) descriptions on how the leader uses emotional intelligence to inspire and motivate his followers. Support each description with an example.
-
An electric charge of 1.20 X 10-C is fixed at each corner of a rectangle 30.0 cm wide and 40 cm long. (k = 9x 10N m/C) What is the magnitude and direction of the electric force on each charge?
-
Find the present value of an annuity with payments of $1,250 at the end of each year for 7 years. The interest rate is 5% compounded annually.
-
How do studies on ancient DNA and paleogenomics contribute to our understanding of human evolution and the interbreeding events between Homo sapiens and archaic hominins such as Neanderthals and...
-
On August 22, 2024, Pharoah Manufacturing sold, on account, one of its Model S14 bulldozers including a 5-year service contract for $227,000. The stand-alone price of the equipment is $186,000 and...
-
If a stock had returns of 32%, 10%, and 18% over the last 3 years and the average return on the stock over this 3-year period was 20%, what was the variance of the stock's returns over this 3-year...
-
Analyze the continuum of care across the Piney Woods Hospital organization and provide recommendations to eliminate redundancy and decrease quality risk. Identify three opportunities to improve the...
-
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...
-
Kipper Company processes a scouring powder through its Compounding Department and Packaging Department. In the Compounding Department, direct materials are added at the beginning of the process, and...
-
Chauncer Manufacturing Corporation produces a dandruff shampoo in three consecutive processes. The costs of Department 1 for June 2019 were as follows: Department 1 handled the following units during...
-
Sweet Fragrances Company uses process costing to account for the manufacture of its perfume. The factory consists of three departments: Blending, Bottling, and Packaging. The production manager of...
Study smarter with the SolutionInn App