Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

PROBLEM 1:

A system keeps track of prices of machine parts in a warehouse. Prices of machine parts in the warehouse may change. Interested users may register with the system to watch price changes of a specific machine part in the warehouse. Each machine part is uniquely identified by its name and ID number. At any time different types of users may register or un-register to watch the price of a specific machine part in the warehouse. Each time when the price of a machine part changes, the system notifies all users registered to watch the price change of this machine part.

a. Develop a class diagram for the system using the Observer design pattern. For each class list all operations with parameters and briefly specify them using pseudo-code. In addition, for each class provide its attributes. Make the necessary assumptions for your design. Notice that the components in your design should be de-coupled as much as possible. In  addition, components should have high cohesion.

b. Provide two sequence diagrams showing:

  • How the user registers to observe a price change of a selected machine part.
  • How the system notifies users about price change of a specific machine part.

PROBLEM 2:

The ACCOUNT component supports the following operations:

OPEN (int p, int y, int a)   // open an account where  p is a pin,  y is an user's identification #, and a is a balance

PIN (int x)    // provides pin #

DEPOSIT (int d);  // deposit amount d  

WITHDRAW (int w);  // withdraw amount w 

BALANCE ();   // display the current balance

LOGIN(int y)   // login where y is a client's identification #

LOGOUT()    // logout from the account

suspend()    // suspends an account

activate()     // activates a suspended account 

close()      // an account is closed

The  ACCOUNT component is a state-based component and supports three types of transactions: withdrawal, deposit, and balance inquiry.  Before any transaction can be performed, operation OPEN(p, y, a) must be issued, where y is a client's identification #, p is a pin used to get permission to perform transactions and a is an initial balance in the account. It is assumed that OPEN() operation is issued only once for a given account. Before any transaction can be performed, operation LOGIN(y) must be issued (where y is a client's identification #) followed by PIN(x) operation. The PIN(x) operation must contain the valid pin # that must be the same as the pin # provided in OPEN(p,  y,  a) operation. There is a limit on the number of attempts with an invalid pin. The account can be overdrawn. If the account is overdrawn  then the withdrawal  transaction cannot be performed. The account may become suspended by suspend() operation. If the account is suspended, withdrawal, deposit, and logout transactions cannot be performed. A suspended account can be activated by activate() operation. In addition, a suspended account can be closed by  close() operation. The detailed behavior of the ACCOUNT component is specified using EFSM. The EFSM of Figure 1 shows the detail behavior of the ACCOUNT component.

Design the 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(123,111,1000), LOGIN(111), PIN(123), DEPOSIT(200), BALANCE(), suspend(), close()

Attachment:- Assignment Files.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92199885

Have any Question?


Related Questions in Computer Engineering

Question after reading this chapter you should now be

Question : After reading this chapter, you should now be familiar with the "Fun" part of Java utilizing the GUI. The GUI offers all kinds of functionality in the graphical sence. Why do you think Java and Javas GUI are s ...

Imposing a tariff leads to the existence of two deadweight

Imposing a tariff leads to the existence of two deadweight triangles, which are the Consumption distortion and Production distortion losses. It is easy to understand why consumption distortion constitutes a loss for soci ...

Mccann co has identified an investment project with the

McCann Co. has identified an investment project with the following cash flows. Year Cash Flow  1   $800  2    1,090 3    1,350 4    1,475 a. If the discount rate is 7 percent, what is the present value of these cash flow ...

A what is gdp deflator and how is it calculatedb if gdp

(a) What is GDP deflator and how is it calculated? (b) If GDP deflator for the year 2014 and 2015 are 105 and 108 respectively, then calculate the increase in price level between 2014 and 2015.

Reduce nfa to dfaconsider the transition table for nfa

Reduce NFA to DFA Consider the transition table for NFA N: 1.Draw a transition graph for machine N. Consider using JFLAP unless you have another tool you know for the problem. (I guess by hand will do, but that is so nin ...

Introduction to software developmentmenu-driven

Introduction to Software Development Menu-Driven Programs TASKS: Language translator. Design a program that display the following menu: Select a language and I will say Good Morning English Italian Spanish German End the ...

Subnetting1 as system administrator you need to create 10

Subnetting 1) As system administrator, you need to create 10 subnets for the Network Address: 192.168.1.0 with a minimum of 10 hosts per subnet. Room for future expansion to more subnets is desirable. Create a table with ...

Question read a sentence with period at the end display the

Question: Read a sentence with period at the end. Display the sentence so that all vowels are in uppercase sample I/O Enter a sentence: proud is self-respect. Output: prOUd Is sElf-rEspEct. I have written a c++ code for ...

Solutions may require mathematical proofs tracing of

Solutions may require mathematical proofs, tracing of algorithms (displaying the calculations and values of variables for each iteration of the algorithm), algorithm design, and writing programs. The following submission ...

Please discuss the design principles that guide the authors

Please discuss the design principles that guide the authors of instruction sets in making the right balance. Provide examples of application of each of the three design principles while designing instruction sets.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As