Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PROBLEM # 1 ( 6 0 points ) The Account component supports the following operations: open ( int x , int y , int z
PROBLEM # points
The Account component supports the following operations:
openint x int y int zsets balance to the value of x pin number to
the value of y and an account # to the value of z
loginint x it is used to login to the account, where x is an account #
logout it is used to logout from the account
pinint x provides pin # parameter x
deposit int d; deposits amount d to the account
withdraw int w; withdraws amount w from the account
balance ; returns the value of the account balance
The Account component is statebased and supports three types of transactions: withdrawal,
deposit, and balance inquiry. Before any account transactions can be performed on the account,
operation login must be issued followed by pin operation. The pin operation must contain
the valid pin # parameter x that must be the same as the pin # provided in the open operation
parameter y It is allowed a maximum of attempts to "provide" an invalid pin. The account
requires a minimum balance of $ If a balance is below the minimum balance in the account,
a $ fee is imposed on each transaction withdraw deposit The detailed behavior of the
Account component is specified using EFSM. The EFSM of Figure shows the detailed
behavior of the Account component.
Design the Account system using the State design pattern. Provide two solutions:
decentralized version of the State pattern
centralized version of the State pattern
Notice that the components in your design should be decoupled as much as possible. In
addition, components should have high cohesion.
For each solution:
a Provide a class diagram for the system. For each class list all operations with parameters and
specify them using pseudocode. In addition, for each class provide its attributes and data
structures. Make the necessary assumptions for your design.
b Provide a sequence diagram for the following operation sequence:
open login pin pin deposit balance logout
Notice when the EFSM model is executed on this test sequence of events the following
sequence of transitions are traversed: T T T T T T T
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started