The class and state machine diagrams below describe (simplified) CashISA objects. These are tax-free savings accounts wh

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

The class and state machine diagrams below describe (simplified) CashISA objects. These are tax-free savings accounts wh

Post by answerhappygod »

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%.
The Class And State Machine Diagrams Below Describe Simplified Cashisa Objects These Are Tax Free Savings Accounts Wh 1
The Class And State Machine Diagrams Below Describe Simplified Cashisa Objects These Are Tax Free Savings Accounts Wh 1 (12.8 KiB) Viewed 39 times
The Class And State Machine Diagrams Below Describe Simplified Cashisa Objects These Are Tax Free Savings Accounts Wh 2
The Class And State Machine Diagrams Below Describe Simplified Cashisa Objects These Are Tax Free Savings Accounts Wh 2 (27.61 KiB) Viewed 39 times
(a)
Write an outline Java class declaration for the CashISA class,
based on the information in the class diagram. Leave the method
bodies empty.
(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.
Visual Paradigm Online Diagrams Express CashISA -bal: double -dep: double -apr: double +CashISAO +deposit(amt: double): void +startTax Year(): void +endTax Year(): void Paradigm Online Diagrams Express Edition

Visual Paradigm Online Diagrams Express Edition deposit(amt) (dep + amt <20000] / bal = bal + amt; dep = dep+amt deposit(amt) (dep + amt == 20000] / bal = bal + amt; dep = dep + amt Allow Deposits Deny Deposits endTaxYear() end Tax Year() /bal = 0; dep = 0; apr = 1.9 Earn Interest entry / bal = bal + bal · apr / 100 startTax Year()/ dep = 0 Visual Paradigm Online Diagrams Express Edition
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply