Consider the following description of a Point-of-Sale (POS) system:
A department store wants to develop a software system to help control the running of business.
The back-end database, which holds information about the stock and transactions, already exists. But it is not currently integrated with any POS devices. The purpose the new system is to make this integration.
The business analyst has identified the following POS’s and activities where the new software system should help:
• At the checkout counter, where the store’s employees check out items bought by customers
• At the information counter, where the store’s employees handle laybys and goods returns
• It should be possible for the system to help a customer check an item’s price by themselves
• The store manager requires the ability to set the discount prices for certain items for a day (i.e. 24 hours) with the condition that the original price must be restored after 24 hours by the Timer (the Timer is an internal actor: it is part of the system).
Write formal specification for the following atomic use cases:
(i) Set Discount Price, and
(ii) Restore Price
Formal Specificatoin:-
SetDiscountPrice:
void setDiscountPrice(Object item_id){
item_id.price = item_id.price - discount;
}
Here this is a formal implementation of setDiscountPrice() method where price is decremented by a specific discount value. Here item id is passed as an argument which will be used to find out the product for which price has to be decremented.
RestorePrice:
void RestorePrice(Object item_id){
if(time_counter>24)
item_id.price = item_id.price + discount;
}
Here this is a formal implementation of restorePrice() method where price is incremented by a specific discount value. Here item id is passed as an argument which will be used to find out the product for which price has to be incremented. A check is placed just above the restoring statement where it checks if the time elapsed has been more than 24 hours or not.
Get Answers For Free
Most questions answered within 1 hours.