CS计算机代考程序代写 SQL scheme database Java flex algorithm 10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 1/24

Exam: Software Modelling and Design (SWEN30006_2021_SM1)
Started: Jun 10 at 10:00

Quiz Instructions
Academic Integrity Declaration
By commencing and/or submitting this assessment I agree that I have read and understood the University’s policy on academic integrity.
(https://academicintegrity.unimelb.edu.au/#online-exams)

I also agree that:

1. Unless paragraph 2 applies, the work I submit will be original and solely my own work (cheating);
2. I will not seek or receive any assistance from any other person (collusion) except where the work is for a designated collaborative task, in which

case the individual contributions will be indicated; and,
3. I will not use any sources without proper acknowledgment or referencing (plagiarism).
4. Where the work I submit is a computer program or code, I will ensure that:

a. any code I have copied is clearly noted by identifying the source of that code at the start of the program or in a header file or, that comments
inline identify the start and end of the copied code; and

b. any modifications to code sourced from elsewhere will be commented upon to show the nature of the modification.

Further Instructions
This exam is worth 60% of your final mark.
All answers are to be given in English.
The marks for each question are indicated at the beginning of each question.
The 150 minutes for the exam includes time for reading, uploading diagrams, and some allowance for internet issues, as well as time answering
questions.
The marks are an indication of how much time should be spent on answering the question: 1 mark = 1 minute with time left over for the other
activities
Make sure you have paper, pencil, and eraser available, as well as a facility for photographing or scanning diagrams.

https://academicintegrity.unimelb.edu.au/#online-exams

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 2/24

Where a diagram is expected as part of an answer, we expect it to be legibly hand drawn, photographed or scanned, and uploaded into your
answer. Hand-drawing on a tablet or similar is acceptable; using a diagramming or modelling tool is not acceptable.
Make sure the images you upload are less than 1MB in size (make sure you have practiced a process for this before the exam).
It is your responsibility to make sure that diagrams used in your answers have been uploaded successfully and are easily readable.

This is an open book assessment. While you are undertaking this assessment you are permitted to:
make use of the textbook, and lecture, workshop and other materials provided on the LMS
make use of the example programs that have been part of this subject, including any code that you have written, provided that you include
suitable attribution

While you are undertaking this assessment you must not:
make use of any messaging or communications technology
capture any part of this exam for purposes other than completing it
act in any manner that could be regarded as providing assistance to another student who is undertaking this assessment, or will in the future be
undertaking this assessment.

The work you submit must be based on your own knowledge and skills, without assistance from any other person.
Due to different students having different windows for completing this exam, on the day of the exam you must not discuss the content of the
exam or your answers with any other person.

5 ptsQuestion 1

For a Hotel Booking system, provide an example of a use case in brief form which has a human primary actor and at least one
non-human supporting (or secondary) actor. For your example, also describe an alternate (or exceptional) scenario that might be
part of an extended form of the use case.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 3/24

p 0 words

Design Pattern Multiple Choice Questions (Questions 2-11)

Each of the following questions describes a design problem. For each question, select the pattern which best deals with the
problem.

2 ptsQuestion 2

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 4/24

Observer

Façade

Adaptor

Composite

Strategy

A computer game company is updating their game engine to support a more sophisticated damage model, so that events such
as explosions or fires can damage many related targets at once, for example, a building, the people in the building, and the
objects carried by the people in the building. How can they achieve this without making the design too complex?

2 ptsQuestion 3

Factory

Observer

Singleton

Auto Machine Corporation is updating their point of sale (POS) system to address the situation when the remote connection with
the central database has failed. The current version of POS system queries the products and prices from the central database
through Simple Object Access Protocol. They have now implemented an SQL database into the POS system to temporarily store
the products and prices. When the POS system wants to query product/price, it needs to transparently use the remote central
database when available, or the local database if it can’t connect.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 5/24

Controller

Strategy

2 ptsQuestion 4

Controller

Composite

Information Expert

Singleton

Decorator

Modular Homes Pty Ltd assembles houses from pre-build standardised rooms. They are introducing additional feature to their
range which need to be added to their ordering system. This feature where their customers can select properties (e.g., colour
scheme and quality of fit-out) which will apply to the whole house (every room), some rooms, or even a unit in the house (e.g., a
cupboard).

2 ptsQuestion 5

Self-guided Co. has a range of mobile apps and web sites for tourists, supported by their proprietary and complex route and trip
planning subsystems. They are developing a new system for tourists which recommend the shortest walking path in limited

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 6/24

Polymorphism

Façade

Controller

Adapter

High Cohesion

circumstances. This system will use their subsystems to provide tourists with directions from a small set of stop-over locations in
a city to a tourist site selected from predefined set of sites.

2 ptsQuestion 6

Composite

Singleton

Factory

Controller

Adaptor

A corporation has a private network which supports limited video connections between its sites and wants to make use of these
in an application. Since it can take time for a connection to be established, it is desirable to be able to allocate an existing free
connection if one is available rather than creating a new one every time. How can an object representing a connection be
provided, at the specific place in the application where a video connection is required?

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 7/24

2 ptsQuestion 7

Strategy

Controller

Observer

Composite

Adaptor

A research project has proposed a series of image recognition algorithms. How can they code up the algorithms to run
experiments comparing how each of the algorithms performs against a common set of tests?

2 ptsQuestion 8

Adaptor

Façade

Go Analytics Ltd is developing a software service that analyses sales for companies who subscribe to their service. The system
can analyze sales in various aspects, with different calculations based on different advanced techniques. However, the capability
of the analytics depends on the membership level of customers, e.g., a comprehensive analysis is applied for Platinum
customers, and a much simpler analysis is available for Silver customers.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 8/24

Observer

Strategy

Singleton

2 ptsQuestion 9

Strategy

Decorator

Adaptor

Controller

Protected Variation

MakeUp Inc. is developing a web/mobile system for online sales. A key system module is “MakeUp_RequestHandler” which
handles all requests either from a mobile or a web browser. The request handling is very complex. It is not only handling sale
requests but also includes other capabilities such as online enquiries, determining a loyalty program and validating coupons.

2 ptsQuestion 10

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 9/24

Adaptor

Strategy

Observer

Façade

Controller

A regulatory body is setting up to evaluate the safety of the software-based drivers of autonomous vehicles. They want to test the
drivers in a common simulated environment; how do they deal with the fact that each driver is developed with a different
interface?

2 ptsQuestion 11

Factory

Low Coupling

Observer

Decorator

An online noodle soup ordering system needs to be able to take an order for noodle soup. The customer chooses a size, soup
type, and noodle type and then has flexibility about adding additional ingredients from a long list. Based on the order, the system
needs to be able to generate information such as a list of all ingredients, a list of all allergens, a recommended reheating time,
and a price.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 10/24

Indirection

5 ptsQuestion 12

Describe the Java class shown below.

Your description must include:

clear reference to the pattern problem/solution on which it is based
an example of an application where it could be used
example code for using it

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 11/24

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 12/24

p 0 words

20 ptsQuestion 13

Consider the description below of the Iccy System.

1. You are about to develop an application to support Insurance Call Centres (called Iccy).
2. The intention is that the application will meet a global need, and so will need to support a wide range of languages.
3. The system will be used by call centre staff handling calls in relation to insurance products regarding:

inquiries about products held by the caller,
inquiries about products not held by the caller,
purchases, and
claims.

4. Some of the companies being targeted for sales have very large client bases; fast response times to Iccy queries by call
centre staff will be critical in keeping client wait times low.

5. As the market for Iccy is expected to be quite lucrative, you have been given substantial resources for the development,
however you have a tight deadline.

Part A

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 13/24

[10 Marks]

From the system description above, identify two architecturally significant requirements, one which is a functional requirement
and one which is a non-functional requirement.

Using the system description above as an example, describe architectural analysis, why it is important, and why the
requirements you have identified are architecturally significant.

Part B

[10 Marks]

Using one of the architecturally significant requirements you identified in Part A, illustrate the contents of a Technical Memo with
the following sections:

1. Factors
2. Solution
3. Motivation
4. Unresolved Issues
5. Alternative solutions

Note: You are not expected to write a whole Technical Memo, but you are to use the identified requirement to show the kind of
content that each section would have.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 14/24

p 0 words

15 ptsQuestion 14

The passage below describes an employment agency domain. The sentence numbering is provided to make it easier for you to
track the various elements of the description. Draw a domain class diagram modelling the elements of the description.

1. For all persons of interest in the domain, we need to know their name, address, phone number, and date of birth.
2. For the job seeker we also need to know their highest qualification, the educational institution at which they were most

recently enrolled, the number of assessment sessions they have been involved in (see below).
3. For staff we also need to know when they joined our organisation
4. There are two kinds of staff, Consultants and Admin staff.
5. Consultants assess a job seeker and their employment prospects: we need to track which staff members were involved in

assessing a job seeker and, for each, whether they were a professional or a trainee.
6. Each time a job seeker is assessed by a staff member (job seekers are only seen one at a time and are only assessed by

one consultant at a time, whether a professional or a trainee), we need the date/time, and activity type for that session.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 15/24

p 0 words

Consider a vending machine with a system interface as described by the UML class below, and with expected behaviour as
described in the text box below.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 16/24

1. When the vending machine is turned on, it will wait for the customer to select a product.
2. It will then display the selected product and wait for the customer to enter a sufficiently high valued coin to pay for the

product.
3. Lower valued coins are returned to the customer; high-valued coins are accepted as payment (no change is provided).
4. Once payment is accepted, the vending machine will dispense the product.
5. When the machine is waiting for payment, the customer can change their mind and cancel the purchase, thereby making the

machine ready for another purchase.
6. At any stage, an error may occur putting the machine into an “Out of Order” state until the problem is corrected and an

internal reset button is pressed by a technician.

10 ptsQuestion 15

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 17/24

p 0 words

Draw a system sequence diagram covering the vending machine scenario where

a customer encounters an error after selecting potato chips (price $1:85), but successfully completes the purchase using a $2
coin after a technician fixes the problem.

Include all external method calls, and use notes and/or self calls to describe internal vending machine behaviour essential to the
scenario.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 18/24

15 ptsQuestion 16

You are assisting a team developing software for a Mars mission. The passage below describes a carbon dioxide (CO2)
filtering system in support of this mission. Draw a state machine diagram for the system to help the team understand the
requirements for the system, based on this description.

1. The system is designed to safely maintain the CO2 level in a Mars dwelling.
2. The system monitors regular updates on the current CO2 level: current(co2).
3. If the CO2 level is detected to rise above max_co2, the filter will start filtering CO2 out until the level reaches max_co2 –

upper_threshold.
4. If the CO2 level is detected to drop below min_co2, an CO2 filter will start adding CO2 in until the level reaches min_co2

+ lower_threshold.
5. When the filter is running, it may detect a fault, in which case it will reset; once the reset is complete, the filter will

immediately continue running as before the fault.
6. At any stage, an emergency is detected, the CO2 filter system will perform an emergency shutdown, and will remain in

the shutdown state until the safe_restart signal is received. It will then go back to normal monitoring of the CO2 level.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 19/24

p 0 words

23 ptsQuestion 17

Consider the following Java code from a Calculator.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 20/24

Part A

[10 Marks]

Draw the UML design class diagram for the design represented in the code. Your design class diagram should:

1. Be as complete as possible.
2. Show Java attributes as UML associations wherever possible.
3. Omit methods which can be inferred to exist through inheritance or similar relationships.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 21/24

Part B

[5 Marks]

List the GoF patterns which are evident in the design/code and for each pattern usage, describe which elements of the
design/code are involved.

Part C

[8 Marks]

Assuming the existence of the relevant constructors, consider the following initialisation code:

// Set expr to -9 * 2

IExpr nine = new Constant(9);

IExpr uexpr = new UnaryExpr(new UMinus(), nine);

IExpr two = new Constant(2);

IExpr expr = new BinaryExpr(uexpr, new Times(), two);

Draw a UML design sequence diagram for:

expr.eval()

Your sequence diagram should show method returns explicitly with concrete values.

Edit View Insert Format Tools Table

12pt Paragraph

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 22/24

p 0 words

7 ptsQuestion 18

Consider the situation where we have huge black and white rectangular pixel-based images and want to be able to answer
queries, for example, “how many black pixels does the image contain?”.

Assume that we are going to use the following method for representing the images. Each image can be represented as a square
grid of pixels (at least the size of the image – see illustration below) with the side of the square being a power of two (i.e. 1, 2, 4,
8, 16, 32, …). Rather than individual pixels being represented, the grid is broken down into exactly four quadrants (labelled NE,
SE, SW, NW) until the whole of a quadrant can be labelled as black, white, or outside (of the image – depicted as yellow).
Obviously, the smallest a quadrant can be is one pixel, however it may be much bigger.

Draw a design diagram which would support this representation and example query. Make it clear which pattern you are
applying to achieve your design. You do not need consider construction in the design.

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 23/24

Edit View Insert Format Tools Table

12pt Paragraph

10/06/2021 Quiz: Exam: Software Modelling and Design (SWEN30006_2021_SM1)

https://canvas.lms.unimelb.edu.au/courses/108646/quizzes/117750/take 24/24

Saving…

p 0 words

Submit Quiz