Académique Documents
Professionnel Documents
Culture Documents
5. Load Items: A stock clerk adds items into the vending machine to
add its stock of beverages.
Q.4 The vending machine delivers a beverage after a customer selects and
pays for it. The machine starts in the waiting state in which it displays the
message “Enter coins”. When the customer inserts coins into the machine,
the machine enters into “Ready” state. When the customer pushes the ok
button, the machine goes in “Dispense” state. In this state, the machine
dispenses the corresponding item. The machine goes in “Out of Stock” state
if item is not loaded. Draw the state transition diagram for above
description.
Q.5 The vending machine delivers a beverage after a customer selects and
pays for it. The machine starts in the waiting state in which it displays the
message “Enter coins”. When the customer inserts coins into the machine,
the machine displays total value of money entered. The customer pushes a
button. The machine dispenses a corresponding item and make change, if
the cost of the item is less than the money inserted. If the cost of the item is
greater than money inserted, the machine shows the message as
“Insufficient money”. Draw the sequence diagram for above description.
Q.13 Consider the class for telephone line with following activities and states: As a
start of a call, the telephone line is idle. When the phone receiver is picked from
hook, it gives a dial tone and can accept the dialing of digits. If after getting dial
tone, if the user doesn’t dial number within time interval then time out occurs and
phone line gets idle.
After dialing a number, if the number is invalid then some recorded message is
played.
Upon entry of a valid number, the phone system tries to connect a call & routes it
to proper destination.
If the called person answers the phone, the conversation can occur. When called
person hangs up, the phone disconnects and goes to idle state.
Draw the state transition diagram for above description of telephone line.
Q.14 Consider a simple digital watch which has a display and two buttons to set it,
the A button and the B button. The watch has two modes of operation, display time
mode, the watch displays hours and minutes, separated by a flashing colon.
The set time mode has two submodes: set hours and set minutes. The A button
selects modes. Each time it is pressed, the mode advances in sequence: display,
set hours, set minutes, display etc.
Within the submodes, the B button advances the hours or minutes once each time
it is pressed. Buttons must be released before they can generate another event.
Draw the state transition diagram for above described digital watch.
Q.15 Develop a class diagram for following description:
The telephone agent uses an order registry and customer catalog to obtain access
to an order & a customer respectively.
The order registry uses an order number as a qualifier to select particular order
instance. A customer catalog uses customer name and phone number as a qualifier
to select particular customer.
The attributes of an order are the order numbers and time when it is placed. The
order consists of many items.
An item has item_number, a quantity, unit price. It also has reference to catalog
item which represents listing.
When an order is cancelled or committed, it cancels or commits each of its items
first.
When an order’s total price method is invoked, the order calls the total price
method of each of items and returns the sum.
Q.16 The telephone agent uses an order registry and customer catalog to obtain
access to an order & a customer respectively.
The order registry uses an order number as a qualifier to select particular order
instance. A customer catalog uses customer name and phone number as a qualifier
to select particular customer.
The attributes of an order are the order numbers and time when it is placed. The
order consists of many items.
An item has item_number, a quantity, unit price. It also has reference to catalog
item which represents listing.
When an order is cancelled or committed, it cancels or commits each of its items
first.
When an order’s total price method is invoked, the order calls the total price
method of each of items and returns the sum.
The telephone agent wants to cancel the item with item number as I101 from order
having order number O123. Show the messages in sequence diagram for
cancellation of item.
Q.17 The telephone agent uses an order registry and customer catalog to obtain
access to an order & a customer respectively.
The order registry uses an order number as a qualifier to select particular order
instance. A customer catalog uses customer name and phone number as a qualifier
to select particular customer.
The attributes of an order are the order numbers and time when it is placed. The
order consists of many items.
An item has item_number, a quantity, unit price. It also has reference to catalog
item which represents listing.
When an order is cancelled or committed, it cancels or commits each of its items
first.
When an order’s total price method is invoked, the order calls the total price
method of each of items and returns the sum.
The telephone agent wants to cancel the item with item number as I101 from order
having order number O123. Show the messages in collaboration diagram for
cancellation of item.
Q.18The telephone agent uses an order registry and customer catalog to obtain
access to an order & a customer respectively.
The order registry uses an order number as a qualifier to select particular order
instance. A customer catalog uses customer name and phone number as a qualifier
to select particular customer.
The attributes of an order are the order numbers and time when it is placed. The
order consists of many items.
An item has item_number, a quantity, unit price. It also has reference to catalog
item which represents listing.
When an order is cancelled or committed, it cancels or commits each of its items
first.
When an order’s total price method is invoked, the order calls the total price
method of each of items and returns the sum. Prepare a use case diagram for
above description.
Q.19 Develop a class diagram to track states of machines in a factory consisting of
several machines. Each machine is in one of several states: running, idle, waiting,
down for unscheduled maintenance, down for scheduled maintenance or off.
A running machine is currently processing an order. An idle machine is available for
processing but is currently without an order to process. The machine is in down
state for scheduled or unscheduled maintenance. The operator is responsible to
change the state.
Each machine has maintenance schedule. Each schedule has a date of last
maintenance and date of next scheduled maintenance.
When the date of next maintenance arrives, the operator sends the machine down
for scheduled maintenance.
Each machine is connected to a failure monitor, which senses hardware failure in
the machine. When the monitor senses a failure, it informs the machine. The
machine changes to the unscheduled maintenance state.
All changes of machine states must be entered in a log. Each entry in the log
includes date and time of the state change, which machine changed state, the
states from and to.
Q.21 Develop a use case diagram to track states of machines in a factory consisting
of several machines. Each machine is in one of several states: running, idle,
waiting, down for unscheduled maintenance, down for scheduled maintenance or
off.
A running machine is currently processing an order. An idle machine is available for
processing but is currently without an order to process. The machine is in down
state for scheduled or unscheduled maintenance. The operator is responsible to
change the state.
Each machine has maintenance schedule. Each schedule has a date of last
maintenance and date of next scheduled maintenance.
When the date of next maintenance arrives, the operator sends the machine down
for scheduled maintenance.
Each machine is connected to a failure monitor, which senses hardware failure in
the machine. When the monitor senses a failure, it informs the machine. The
machine changes to the unscheduled maintenance state.
All changes of machine states must be entered in a log. Each entry in the log
includes date and time of the state change, which machine changed state, the
states from and to.
Q.23 A customer decides to upgrade her PC and purchase a DVD player. She begins
by calling the sales department of PC vendor and they tell her to contact customer
support. She than calls customer support and they put her on hold while talking to
engineering. Finally, customer support tells the customer about several supported
DVD options. The customer chooses a DVD and it is shipped by the mail
department. The customer receives the DVD , installs it satisfactorily and then
mails her payment to accounts department. Draw the activity diagram for above
description.
Q.24 A customer decides to upgrade her PC and purchase a DVD player. She
begins by calling the sales department of PC vendor and they tell her to contact
customer support. She than calls customer support and they put her on hold while
talking to engineering. Finally, customer support tells the customer about several
supported DVD options. The customer chooses a DVD and it is shipped by the mail
department. The customer receives the DVD , installs it satisfactorily and then
mails her payment to accounts department. Draw the sequence diagram for above
description.
Q.25 A customer decides to upgrade her PC and purchase a DVD player. She
begins by calling the sales department of PC vendor and they tell her to contact
customer support. She than calls customer support and they put her on hold while
talking to engineering. Finally, customer support tells the customer about several
supported DVD options. The customer chooses a DVD and it is shipped by the mail
department. The customer receives the DVD , installs it satisfactorily and then
mails her payment to accounts department. Draw the collaboration diagram for
above description.
Q.26 The objective of the system is to automate all the activities of the canteen
right from purchasing and to maintaining the kitchen. The system should maintain a
detailed account of all provisions bought and food served at the canteen. Several
inquiry facilities should also be provided to view expenses incurred, planned
menus/cash payment. In short following are the list of facilities which should be
provided with the system: list of items served with rates, daily menu preparation,
daily transactions, availability of information on intranet for reports and inquiries,
purchases and issues.