Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROBLEM # 1 ( 6 0 points ) The Account component supports the following operations: open ( int x , int y , int z

PROBLEM #1(60 points)
The Account component supports the following operations:
open(int x, int y, int z)//sets balance to the value of x, pin number to
// the value of y, and an account # to the value of z
login(int x)// it is used to login to the account, where x is an account #
logout()// it is used to logout from the account
pin(int 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 state-based 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 3 attempts to "provide" an invalid pin. The account
requires a minimum balance of $100. If a balance is below the minimum balance in the account,
a $10 fee is imposed on each transaction (withdraw, deposit). The detailed behavior of the
Account component is specified using EFSM. The EFSM of Figure 1 shows the detailed
behavior of the Account component.
Design the Account system using the State design pattern. Provide two solutions:
de-centralized version of the State pattern
centralized version of the State pattern
Notice that the components in your design should be de-coupled 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 pseudo-code. 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(80,123,222), login(222), pin(111), pin(123), deposit(100), balance(), logout()
Notice when the EFSM model is executed on this test (sequence of events), the following
sequence of transitions are traversed: T1, T2, T3, T8, T10, T13, T4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions