Professional Documents
Culture Documents
MidTermExam07 Solu
MidTermExam07 Solu
MidTermExam07 Solu
Student Number______________________
Fall 2007
SFWR ENG 3KO4 / 3MO4
Software Development For Computer / Electrical Engineering
INSTRUCTOR: Dr. Kamran Sartipi
DAY CLASS
DURATION OF EXAMINATION: 50 Minutes
MCMASTER UNIVERSITY MIDTERM EXAMINATION October 18, 2007
THIS EXAMINATION PAPER INCLUDES 6 PAGES AND 7 QUESTIONS. YOU ARE RESPONSIBLE
FOR ENSURING THAT YOUR COPY OF THE PAPER IS COMPLETE.
Special Instructions:
Answer to each question only in the provided space for that question.
Your answer to each question should be brief.
Answer all questions.
Total mark is 100.
1. General guideline that governs the execution of some activity; this guideline is a rigorous,
systematic, and disciplined approach.
2. Similar to above but has more restricted applicability and is more mechanical.
3. Used to promote a certain approach to solving a problem.
4. Developed to support the application of the three above.
a) Method (1)
b) Tools (4)
c) Methodology (3)
d) Technique (2)
Consider the Finite State Machine (FSM) below and answer the following questions:
a) Which of the following compiler components uses FSM:
b) For the new state qeror (shown below), add the corresponding arrows such that this FSM only
recognizes two words.
Consider the description of an elevator in Z schema that we discussed in class (shown below). The elevator
has 20 floors. The table below shows the status of the internal request signals (only signals that are ON are
shown), and external request signals. The elevator is currently in floor 10 (F10) and its direction is UP.
The elevator system uses three sets “Pri1”, “Pri2”, and “Pri3” to manage the strategy for serving
different internal and external requests. Based on the specifications for these three sets, answer the
followings:
a) Using the schema “System” show the contents of the sets “Pri1”, “Pri2”, and “Pri3 in terms of
the floor numbers in each set.
b) For each set in (a) show which floor will get service first.
Next Floor To Serve = F14
Figure below illustrates the component diagram of a “Fast Food Restaurant System” that
we discussed in class. In bullet form explain the steps for performing the following services:
1. Taking customer orders from the restaurant menu by order takers and handling order payment.
a. Order Taker (OT) gets Menu from Database (by invoking DatabaseQuery service), and
shows Menu to the customer.
b. OT sets up an order for the customer (according to customer’s choice of menu items) and
stores the “completed” but “unpaid” order in Database (again using Database interface).
c. OT receives proper cash from customer and changes the status of the new order from
“unpaid” to “paid” (by invoking Database Query interface).
2. Assembling orders from chutes and delivering the orders to the customers.
a. OT informs Assembly Coordinator (ASC) (via NewOrderCompleted) that a new
“completed” order is in Database to be assembled.
b. ASC retrieves new order from Database (as above).
c. ASC sends new order to an available assembler by invoking DisplayOrder interface.
d. Assembler fetches proper food items from Chute (via Get_items interface) and assembles
the order but does not deliver it to the customer.
e. ASC informs Assembler that the order has been “paid” (using DeliverOrder) and the
Assembler delivers the order to customer.
In your answer you should use different types of data in the “Database” component.
c) Assume that these two charts are used to design a process of generating documents and printing
them. In a bullet form, explain how this process can be performed by this design.
a. In AC the user starts the operations by initiating a Power-On signal which causes the SC
to transit from Off state to On state, and then will wait in the WAIT state.
b. User in AC sends proper system data to INIT activity which sets up the system and issues
the signal “Execute” to SC and consequently the concurrent (and) state EXECUTING is
activated and both states A and Y become active. State A enables activity A which in turn
receives the document file (e.g., a latex file) from the user (as external activity) and
operates on it.
c. The resulting file (e.g., a postscript file) will be stored in the data store in AC.
d. In the next step both states B and Z from SC will be active. Entering in state B enables
activity B in AC which receives the latex file from data store and generates a postscript
file and sends it to the printer (shown as OUT external activity).
e. Also the states Y and Z will be alternatively activated which can be interpreted as: when
Z is active it enables activity Z in AC that monitors the status of the files in the Datastore.
If some anomaly in the intermediate files in datastore occurs, then activity Z recognizes
that and will generate event “Reset” which triggers the corresponding event Reset and all
activities in the system stop and the system enters the WAIT state again, waiting for the
user to initialize the system through activity INIT in AC.