Design Phase
Design Phase
Drivers swipe
their credit card through a reader connected to the pump; the card is verified
by communication with a credit company computer, and a fuel limit is established. The
driver may then take the fuel required. When fuel delivery is complete and the pump
hose is returned to its holster, the drivers credit card account is debited with the cost of
the fuel taken. The credit card is returned after debiting. If the card is invalid, the pump
returns it before fuel is dispensed.
Tips: Please refer to chapter 6 and 7 from Ian book to answer these questions.
1. Using the UML graphical notation for object classes, design the following object
classes identifying attributes and operations. Use your own experience to decide
on the attributes and operations that should be associated with the objects: A
telephone, A printer for a personal computer, a personal stereo system, A bank
account, A library catalogue.
2. Identify possible objects in the system below and develop an object-oriented
design for the system.
Question 1
Object
Pump
Attributes
Fuel dispensed
:Pump
Price
Car reader
swipeCard(g
as)
Operations
Activate
:
CardCompanyCompu
Deactivate
Hose status
Deliver fuel
Trigger status
Stock update
Fuel type
Card number
:
AutomatedGasSyste
verifyCard()
Read card
acknowledge
Card type
Check status
()
[isValid]
Card status
Process(gas)
Credit limit
Current fuel level
Fuel tank
Communication system
System controller
Print receipt
Add fuel
fuel_limit_establish(
Remove fuel
)
Number dialed
Send card number
fuel_taken()
Credit limit
Return card status
Card Numbercost_acknowledg
e()
debit_amoun
Max delivery t()
return_card() Price table
acknowledge
()
Fuel delivered
Card type
Price table
acknowledge
()
Fuel prices
[isValid]
Lookup
Amend price
fuel_dispensed()
Question 2