Question: 2 CSCUMPS 17 December 2020 Do not sign this declaration. 1. The class and state machine diagrams below describe (simplified) Cashisa objects. These are tax-free
2 CSCUMPS 17 December 2020 Do not sign this declaration. 1. The class and state machine diagrams below describe (simplified) Cashisa objects. These are tax-free savings accounts which cap the deposits at 20,000 per tax year. CashisAs have attributes for the current balance, the amount of money deposited during the current tax year, and the annual interest rate (also known as APR). CashisAs offer bank customers an operation to deposit money. CashiSAs offer the bank operations to start a new tax year, and to end the tax year and credit the earned interest to the account. The state machine diagram models an account with an annual interest rate of 1.9% CashISA tal double -dep. double -apr double CashISAD cepositamtdouble vold start Tax Yoard : void HendTax Year) void depant 20000 ba... dep.am Depostment-20000 OD Hon Dapaus wrote Year -0. de 0. entrybai bala100 Taka . (a) Write an outline Java class declaration for the CashisA class, based on the information in the class diagram. Leave the method bodies empty (5) (b) Complete the implementation of the CashiSA class by translating the state machine diagram into Java code. This translation requires no knowledge of actual Cashisa savings accounts. Syntactic correctness of your Java code is not important, but your code must be functionally correct, that is, it should implement exactly the functionality specified by the state machine diagram. [20] 2 CSCUMPS 17 December 2020 Do not sign this declaration. 1. The class and state machine diagrams below describe (simplified) Cashisa objects. These are tax-free savings accounts which cap the deposits at 20,000 per tax year. CashisAs have attributes for the current balance, the amount of money deposited during the current tax year, and the annual interest rate (also known as APR). CashisAs offer bank customers an operation to deposit money. CashiSAs offer the bank operations to start a new tax year, and to end the tax year and credit the earned interest to the account. The state machine diagram models an account with an annual interest rate of 1.9% CashISA tal double -dep. double -apr double CashISAD cepositamtdouble vold start Tax Yoard : void HendTax Year) void depant 20000 ba... dep.am Depostment-20000 OD Hon Dapaus wrote Year -0. de 0. entrybai bala100 Taka . (a) Write an outline Java class declaration for the CashisA class, based on the information in the class diagram. Leave the method bodies empty (5) (b) Complete the implementation of the CashiSA class by translating the state machine diagram into Java code. This translation requires no knowledge of actual Cashisa savings accounts. Syntactic correctness of your Java code is not important, but your code must be functionally correct, that is, it should implement exactly the functionality specified by the state machine diagram. [20]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
