We know the secret of your success
PAPER TITLE: SOFTWARE DEVELOPMENT WITH JAVA
DATE: Friday, 21 September 2018
PART 1
Question 1 Which two of the following statements about software development are true? (Select two options)
ANSWERS(Purchase full paper to get all the solution) 4. A common practice in iterative software development is to restrict the initial development to a small subset of the requirements of the system.
5. Enhancing the system by adding extra facilities is part of the maintenance phase.
Question 2 Based on the information above which two of the following statements are true? (Select two options)
A. The diagram shows that team12 and team3 are linked to fixture3 via different associations.
B. The diagram shows how team12, team3 and fixture3 interact.
C. The diagram shows a collaboration between team12 and fixture3.
D. The diagram shows that team12 has an attribute ”Brown Bears”
E. The state of fixture3 includes the homePoints attribute value 15.
Question 3 Which two of the following statements relating to the requirements specification process are true? (Select two options)
‘The software should implement each ward list as an indexed list.’
Question 4 Which two of the following statements about conceptual modelling are true? (Select two options)
Question 5 The following is an extract from a requirements document for a system for a yoga school. The incomplete class diagram below forms part of a conceptual model for the system.
Each yoga class is led by one yoga instructor and each yoga instructor leads between one and ten yoga classes.
Based on the information above, which three of the following statements are true? (Select three options)
Question 6 The following is an extract from a requirements document for a University administration system. The incomplete class diagram below forms part of a conceptual model for the system.
An academic belongs to a single faculty and may be mentored by other academics who must be in the same faculty.
Figure 3
Based on the information in Figure 3, which two of the following statements are true? (Select two options)
If aStudent and bStudent are Student objects that are linked to the same Faculty object then aStudent and bStudent must be linked to the same Academic object.
Question 7 Which two of the following statements are true? (Select two options)
A. Coupling is a measure of how strongly related and focused the responsibilities of a component are.
B. A method’s post-condition states what the method must achieve regardless of whether the pre-condition is satisfied or not.
C. It is often possible to identify some of a method’s pre-conditions from the Javadoc specification of the exceptions that the methods throw.
D. If there is no explicit modifier in front of a member of a Java class then the member cannot be accessed from outside the class’s package.
E. A method’s pre-condition should state what invoking the method achieves.
Question 8 Which two of the following statements about object orientated software development are true? (Select two options)
1. One benefit of component-based software development is that implementation errors are separated from specification errors.
Questions 9 to 11 are based on the following information.
The incomplete class diagram below is part of a structural model being developed for a dental practice system.
It is followed by a use case description, and a walk-through and an incomplete sequence diagram for a particular scenario of that use case.
DentalCoord is the coordinating class and the coordinating object is surgery. Dental practice staff include a number of dentists and hygienists and these are the only dental staff relevant for this system. The attribute procedure in class Appointment is of user-defined type Procedure which is restricted to taking the three values CLEAN, CHECKUP, TREATMENT. The attribute name of the class Client and the attribute name of the class StaffMember are of the user-defined type Name.
Figure 4
Use case: List a member of dental staff’s appointments and clients for a given procedure
The receptionist identifies a member of dental staff and provides a procedure. For each appointment for that procedure to be taken by that staff member, the system displays the date of the appointment and the name of the client who made the appointment.
Walk-through:
Given: the StaffMember object dentist4, and the procedure CHECKUP:
If its procedure value is CHECKUP,
4. access the Client object, aClient, linked to anAppointment;
5. add (anAppointment, aClient) to results
6. Return results
Incomplete sequence diagram (some messages answers replaced by letters P,Q,X,Y,Z
Question 9 Which one of the following statements could be a correct identification of the missing text indicated by the labels X, Y and Z in the sequence diagram shown in Figure 5? (Select one option)
A. X is CHECKUP; Y is TREATMENT; Z is (appointment8, client9) B. X is TREATMENT; Y is CHECKUP; Z is client9 C. X is CLEAN; Y is CLEAN; Z is client17 D. X is CHECKUP; Y is CLEAN; Z is client17 E. X is CHECKUP; Y is TREATMENT; Z is client9 F. X is CHECKUP; Y is CHECKUP; Z is client9
Question 10 On the basis of the information provided in Figures 4 and 5 which two of the following statements are true? (Select two options)
A. It is possible to create a sequence diagram that corresponds to the given walk-through and has no messages sent by dentist4.
B. Figure 5 shows step 2 of the walk-through is carried out by Dentist.
C. Figure 5 shows step 2 of the walk-through is carried out by surgery.
D. Figure 5 shows step 3 of the walk-through is carried out three times.
E. Figure 5 shows step 4 of the walk-through is carried out three times.
F. Figure 5 shows step 4 of the walk-through is carried out by dentist4.
Question 11 On the basis of information provided in Figures 4 and 5 and the walkthrough, which two of the following statements is true? (Select two options)
A. A method whose specification begins as follows is appropriate for the protocol of Client: Client getClient()
B. The association hasAppointments needs to be navigated from DentalCoord to StaffMember
C. A method whose specification begins as follows is appropriate for the protocol of Appointment: Client getClient()
D. A method whose specification begins as follows is appropriate for the protocol of DentalCoord:
Map getAppointmentsAndClients(Dentist aDentist, Procedure aProcedure)
E. The association takes needs to be navigated from StaffMember to Appointment
F. The association makes needs to be navigated from Client to Appointment
Question 12 Which two of the following statements about designing software are true? (Select two options)
Question 13 Which two of the following statements about detailed design and implementation are true? (Select two options)
Question 14 Which two of the following statements about implementation and testing are true? (Select two options)
Question 15 Which two of the following statements about the M256 approach to implementing software in Java are true? (Recall that in M256 the first code iteration is the first stage in implementing a core system.) (Select two options)
Question 16 Which two of the following statements about user interfaces and their design are true? (Select two options)
Question 17 Which two of the following statements about user interfaces and their design are true? (Select two options)
Question 18 Which two of the following statements about building a graphical user interface (GUI) using the M256 approach are true? (Select two options)
Question 19 Which two of the following statements are true? (Select two options)
Question 20 Which two of the following statements are true? (Select two options)
Exactly one instance of a class is required.
PART 2
This part contains four questions, each worth 20 marks. You should attempt three of these questions.
Question 21 (20 marks) The following is an extract from a requirements document for a part of the administration system for a motor racing club. This part of the system keeps track of existing club members and future driving lessons and car hires.
System domain
There are two types of member: students and instructors. Students are at one of two levels, “regular” or “advanced”. The level of a student determines the type of car that they are allowed to drive: regular students are permitted to drive only sports cars, whilst advanced students may drive any type. Instructors are assigned up to twenty students. Each student is assigned to a single instructor. Any member can book a lesson or make a reservation to hire a car. A member can book any number of lessons but can make no more than five reservations to hire cars. A student’s lesson is always given by the instructor to whom the student is assigned. An instructor can book a lesson to be given by any other instructor. Lessons are one hour long, start on the hour and are charged at the fixed hourly rate of the instructor giving the lesson. There is no vehicle charge for a lesson. Reservations for hire are for a day. The charge for a hire is the fixed daily rate for the car. Sports cars may be driven on public roads and therefore must display a registration number. Racing cars are of various categories: for example “Formula 2”, “Formula 3”. Racing cars do not have registration numbers.
No information about lessons or hires that have already taken place is kept by this system.
Use cases
Record new lesson. The user supplies the date and start time of the lesson. The user identifies the member booking the lesson, the instructor giving the lesson and the car the lesson will be in. If the member is a student, the car type must be appropriate to the student's level and the instructor giving the lesson must be the instructor assigned to the student. If the member is an instructor, the instructor giving the lesson must be a different instructor. If, for either of the members or for the car, there is already a reservation recorded for the given date or a lesson recorded for the given time and date, then the system informs the user. Otherwise the system records the lesson’s date, start time and charge, and that it is booked by the given member and provided by the given instructor in the given car.
Display member’s reservations. The user identifies the member. If the member has made any reservations for hires, then the system displays for each reservation the following information:
the name of the member and the date the reservation is for; the registration number of the car, if it is a sports car;
the category of the car, if it is a racing car; and the charge for the hire
Note that in this question you are dealing with a conceptual model. You will lose marks for including in your answers anything that is not relevant for a conceptual model.
Figure 6 is an incomplete class diagram for a conceptual model with four classes unnamed and all the associations omitted.
Figure 6
Question 22 (20 marks) The following unfinished class diagram is a part of a structural model being developed for a small airline administration system.
Figure 7
Invariants
The following is a description of one of the use cases for this system.
Note that each booking is for only one passenger for one flight.
Cancel a booking
The user identifies a passenger and a flight. The passenger must have a booking for the flight. The booking that is to be cancelled and all information about it is removed from the system.
The object diagram in Figure 8 shows the relevant objects and links for a particular scenario of the use case, before the use case is initiated. Attributes that are not relevant to the question have been omitted.
Give the complete sequence diagram in your answer book.
e. Now consider the following scenario for the same use case. The object diagram represents the situation before the use case is initiated.
Write down the remainder of the walk-through for this scenario. (2 marks)
Question 23 (20 marks) Consider the class diagram in Figure 11 and class descriptions, extracted from an implementation model for a system to assist a company in managing its stock control so that it can fulfil its orders: the Stock Control System. Then answer part (a) which follows. You are advised to read the questions first and then refer to the extract from the implementation model in order to answer them. Note that this question contains five parts in all. The last four parts, (b), (c), (d) and (e), are based on dynamic models which are given later.
The Figure 11 class diagram and following class descriptions are part of an implementation model for the Stock Control System. Classes, attributes, links and methods that are not relevant for this question have been omitted.
Read the table and the following notes and then write the body of a JUnit test method test1AddOrderItem corresponding to the test case specification
Notes:
Your answer should consist of the body of the test method, not including the header
You should assume that except for the method being tested all methods specified in the given extract from the implementation model have already been implemented and tested.
You can use any valid values for attributes that are not specified in Table 1. You are not required to provide Javadoc, or any other comments. (7 marks)
One use case in the Stock Control System is the following:
Add Order Item
The user identifies a product and an order and provides a quantity to be ordered. If the provided quantity is at least 1 and the quantity of the product in stock is not less than the provided order quantity, the system records that an order item for that quantity of the product has been added to the order and decrements the stock level of the product by the quantity ordered. If the provided quantity is less than 1 or the quantity of the product in stock is less than the provided quantity ordered, the system displays an appropriate message.
The following are dynamic models for a design for the above use case. Use the scenario illustrated in the object diagrams in Figures 12 and 13 and the walk-through, and sequence diagram in Figure 14 for the scenario to answer parts (b), (c), (d) and (e) which follow. The coordinating object is called controller.
Walk-through for the above scenario:
Given: the Order object, order3, the Product object, product11 and the order quantity 2.
As the check succeeds:
You should not include methods that would be implemented in the first code iteration and should only include methods that are specified in the class descriptions. Do not include additional methods that might be needed for testing. Specify the class and name for each method. (4 marks)
Question 24 (20 marks)
(a) This part of the question is about improving an initial prototype graphical user interface (GUI) design for a desktop computer application to control a ‘Where am I?’ display for the outside of an office door. Read the descriptions below and then answer the questions that follow.
The ‘Where am I?’ display
Figure 11 shows the display outside the office door. The arrow on the display swings to indicate the occupant’s whereabouts. The Unavailable label is fixed but all of the other location labels are programmable. The position of the arrow is driven by a set of sensors whose details you do not need to consider. If a visitor presses the Further details button a message pre-set by the room’s occupant is displayed, for example giving a mobile number for the visitor to text.
The user interface
The initial prototype user interface of the desktop application to control the door display is comprised of two screens, as shown below.
The main screen
The main screen (Where am I?) is intended to allow a user to do the following:
From the main screen the user can navigate via a button (Set availability) to the Availability screen.
The Availability screen
This screen is intended to allow the user to enter set times of the week when the door display will indicate ‘Unavailable’. This is done using a table. For the purposes of this question all you need to know about tables is that they can be used for entering and displaying information in cells, which are intersections of columns and rows. In this case the columns represent days of the working week and the rows represent times of the working day in hourly intervals.
When the user selects a cell (or group of cells) this is indicated by the cell(s) being highlighted. The user then clicks on the Set unavailable button and these cells become shaded, indicating unavailability.
Clicking on the Back button returns the user to the main screen.
Some user interface design heuristics (introduced in Unit 12) are listed below
Minimise the users’ memory load Be consistent
Allow for undoability and commitment Use simple grouping and ordering
Prevent errors
The Borrow Book screen allows the user to initiate the Borrow Book use case. Here is a description of this use case.
Suppose that a user interface designer working on the Borrow Book use case has decided that the user will select from a scrollable list of the (unique) names of all the members of the faculty library. When the user makes this selection a second scrollable list will display the titles of all the available books i.e. all the books the member does not have on loan and for which copies are available to be borrowed. When the Borrow Book screen is first displayed the first name in the list of member names is selected by default and the second list displays the titles of books available to be borrowed by that member.
The librarian selects a member and a book to be borrowed and clicks the Borrow book button. If the selected member already has the maximum number of books on loan, no new loan is recorded and an appropriate message is displayed in the outcome text area. Otherwise the system records the loan of the selected book to the selected member and the details are confirmed by a message in the outcome text area with the following information: the book title, the member’s membership number and name, and the issue and return dates.
This is illustrated by the design sketch in Figure 17.
When this design is implemented the GUI will communicate with the core system implemented in the package librarycore, which includes a coordinating class LibCoord and several other core classes including Loan and Book.
Below are extracts from the Javadoc for some methods of the core system classes, some, but not all of which are required for building the Borrow Book screen.
Class LibCoord
getMembers
public java.util.Collection getMembers()
Returns a collection of all the members of the library.
Returns:
a collection of all Member objects
getAvailableBooks
public java.util.Collection getAvailableBooks()
Returns the books that have at least one copy not currently being borrowed.
a collection of all the Book objects whose copiesAvailable attribute has a value of 1 or more
getBooksOnLoan
public java.util.Collection
getBooksOnLoan(Member aMember)
Returns the books on loan to a member.
Parameters:
aMember – a member
the Book objects linked to Loan objects linked to aMember.
borrowBook
public Loan borrowBook(Book aBook, Member aMember)
Records the borrowing of a book by a member.
If aMember is linked to maximum number of Loan objects then returns null.
Otherwise a new Loan object aLoan is created with date of issue set to the current date, return date set to the current date plus the fixed loan period and:
This is the coordinating method for Borrow a Book.
aBook – a book being borrowed by a member
aMember – a member borrowing a book
the Loan object representing the loan of aBook to aMember
Throws:
IllegalStateException if a copy of aBook is not available to be borrowed.
IllegalArgumentException if aMember already has aBook on loan.
Class Book
getTitle
public String getTitle()
Returns the receiver’s title.
title
toString
public String toString()
Returns the receiver’s title
a string object representing the receiver
Class Loan
getIssueDate
public M256Date getIssueDate()
Returns the receiver’s issue date.
issueDate
getReturnDate
M256Date getReturnDate()
Returns the receiver’s return date.
returnDate
Returns a string representation of the receiver: the book title, the member’s membership number and name and the issue and return dates.
a String object representing the receiver
Below are some notes on the GUI that you will need to answer parts (i) and (ii).
If the selected member has already borrowed the maximum number of books no new loan is recorded and a message in the outcome text area states
"The member must return a book before borrowing another one".
Otherwise the loan is recorded and a message is displayed in the outcome text area showing the book title, the member’s membership number and name and the issue and return dates; also the 'Select a book to borrow' list is updated so that it no longer shows the title of the book just borrowed. (7 marks)
[END OF QUESTION PAPER]
Purchase full paper by adding to cart
Last updated: Sep 02, 2021 12:17 PM
Your one-stop website for academic resources, tutoring, writing, editing, study abroad application, cv writing & proofreading needs.