Premium Resources

We know the secret of your success

M256/R Software development with Java Undergraduate Level Course Examination 2009

$39.00

PAPER TITLE: SOFTWARE DEVELOPMENT WITH JAVA

DATE: Wednesday 21 October 2009

 

Part 1

Question 1

Which two of the following statements about object-oriented software development are true? (Select two options)

  1. The term integrated development environment (IDE) refers to the real-world context within which the developers and the client work together to produce the new system.
  2. The behaviour of a system is based on the interactions between its objects.
  3. One advantage of language-independent software development is that the focus of development can initially be on general issues before becoming progressively more detailed.
  4. Developing a dynamic model typically involves decisions such as which existing classes can be reused and what programming constructs are appropriate.
  5. The term large-scale project refers to the fully operational system that is delivered to the client, before any maintenance takes place.

 

ANSWERS(Purchase full paper to get all the solution)

C. One advantage of language-independent software development is that the focus of development can initially be on general issues before becoming progressively more detailed.

D. Developing a dynamic model typically involves decisions such as which existing classes can be reused and what programming constructs are appropriate.

 

 

Question 2

The following diagram illustrates aspects of a football league administration system.

Which three of the following statements are true? (Select three options)

  1. The diagram shows that team2 has an attribute "Falkirk Fliers".
  2. The diagram shows that team2 and team3 are linked to match1 via different associations.
  3. The diagram shows a collaboration between team2 and match1.
  4. The diagram shows that match1 has an attribute homeGoals.
  5. A diagram such as the one above can be used to illustrate the state of part of a system at a particular instant.
  6. A diagram such as the above illustrates how objects interact.

 

 

 

Question 3

Which one of the following statements about a requirements document is true? (Select one option)

  1. It will usually describe constraints and behavioural requirements separately.
  2. It does not usually contain any information about testing the system.
  3. It is usually written primarily by the client, with the analyst acting as advisor.
  4. It should not include details of the development schedule or budget.

 

 

Question 4

Which two of the following statements about conceptual modelling are true? (Select two options)

  1. The terms conceptual model and class diagram have the same meaning.
  2. A conceptual class is one which models abstract entities.
  3. An entity in the system domain that refers to connections between other significant entities in the system domain may be appropriately modelled by an association between classes.
  4. The term invariant means an attribute of a conceptual class which has a constant value for all objects of that class.
  5. An initial structural model can form the basis for designing the software system.

 

 

 

Question 5

Based on the information above, which two of the following statements are true? (Select two options)

  1. It is possible for a Manager object to be linked to a Reservation object.
  2. The association handles is derived.
  3. The association servesAt is derived.
  4. The multiplicity of the isFor association at the Reservation end should be 0..*.
  5. The multiplicity of the isFor association at the Table end should be 0..*.
  6. The class Waiter generalises the class StaffMember.

 

 

Question 6

Based on the information above, which one of the following is an invariant that would be required in addition to the class diagram, as part of the conceptual model? (Select one option)

  1. A Reservation object cannot be linked to more than one Customer object.
  2. A Reservation object cannot be linked to more than one Waiter object.
  3. If a Waiter object aWaiter and a Reservation object aReservation are linked, then aWaiter must be linked to the Table object that is linked to aReservation.
  4. If a Waiter object aWaiter and a Table object aTable are linked, then aTable must be linked to a Reservation object that is linked to aWaiter.

 

 

Question 7

Which two of the following statements about object-oriented software development are true? (Select two options)

  1. To prevent privacy leaks from a component, no getter methods should be specified for the attributes of the classes within the component.
  2. There may be potential for a privacy leak when an instance variable references a mutable object.
  3. A defensive copy of an object must be an immutable object.
  4. One challenge of design with reuse is the frequent lack of appropriate readily-available pre-existing components.
  5. One challenge of design with reuse is that testing is generally more complex.

 

 

 

Question 8

Which two of the following statements about the M256 approach to designing software are true? (Select two options)

 

  1. Coordinating methods for use cases which provide information should return attribute values rather than core system objects in order to prevent privacy leaks.
  2. The user interface should not send messages directly to objects in the core system.
  3. A coordinating object typically receives messages from the user interface to initiate the behaviour of the core system.
  4. Coordinating methods should be specified to have default (i.e. package) accessibility.
  5. The classes in an implementation model typically have protocols containing method specifications.

 

 

 

 

Question 9

Which one of the following statements is a correct identification of the missing text indicated by the labels X, Y and Z in the sequence diagram? (Select one option)

  1. X is RestaurantCoord; Y is customer4; Z is 31/12/09.
  2. X is RestaurantCoord; Y is (table5, customer4); Z is true.
  3. X is restaurant; Y is customer4; Z is 31/12/09.
  4. X is restaurant; Y is customer5; Z is 31/12/09.
  5. X is restaurant; Y is (reservation3, customer4); Z is 31/12/09.
  6. X is restaurant; Y is customer4; Z is true.

 

 

Question 10

On the basis of the above information, which three of the following statements are true? (Select three options)

  1. In this scenario step 2 of the walk-through is carried out by restaurant.
  2. In this scenario step 4 of the walk-through is carried out by restaurant.
  3. In this scenario step 6 of the walk-through is carried out twice.
  4. reservation1 is not linked to any Table object.
  5. It is possible to create a sequence diagram that shows different collaborations from those in Figure 4, but which still corresponds to the given walk-through.
  6. It is not possible to create a sequence diagram that shows different collaborations from those in Figure 4, but which still corresponds to the given walk-through.

 

 

 

Question 11

 

On the basis of the above information, which two of the following statements are true? (Select two options)

  1. A method whose specification begins as follows is needed in the protocol of

RestaurantCoord:

Map getTablesAndCustomers(M256Date aDate)

  1. A method whose specification begins as follows is needed in the protocol of

RestaurantCoord:

Map getTablesAndCustomers(M256Date aDate)

  1. A method whose specification begins as follows is needed in the protocol of

RestaurantCoord:

Table getTable()

  1. A method whose specification begins as follows is needed in the protocol of

Reservation:

Table getTable()

  1. A method whose specification begins as follows is needed in the protocol of

Table:

Table getTable()

 

 

Question 12

Which two of the following statements about designing software are true?

(Select two options)

  1. Low cohesion is generally considered preferable.
  2. A design based on forking may involve an object sending more than one message to carry out a particular responsibility.
  3. A design based on forking typically requires less coupling than does a design based on cascading.
  4. The coordinating object is the information expert for all of the tasks required of the core system.
  5. If the coordinating class does too much work then the cohesion of other core system classes may be reduced.

 

 

 

Question 13

 

Which two of the following statements about detailed design and implementation are true? (Select two options)

  1. The terms user-defined type and utility class have the same meaning.
  2. An enumerated type may be used to implement an instance variable which has an infinite number of possible values.
  3. A user-defined type may not also be an enumerated type.
  4. A link reference may be implemented using a single object that is not a collection of other objects.
  5. For certain instance variables, the designer selects an interface type for the instance variable whereas the programmer selects an appropriate class for the objects that the instance variable references.

 

 

Question 14

Which two of the following statements about implementation and testing are true? (Select two options)

  1. It is generally impossible to use testing to guarantee that software is entirely bug-free.
  2. In test-driven development all test cases are specified as soon as the initial structural model has been created.
  3. Test-driven development necessarily involves a use case-driven approach to implementation.
  4. Once the system is implemented the client is generally free to apply any acceptance tests they wish in order to decide whether they will accept the system.
  5. Test suites can be used in regression testing.

 

 

Question 15

Which two of the following statements about 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)

  1. In the first code iteration an instance variable should always be declared for every attribute present in the implementation model.
  2. In the first code iteration a hashCode() method for each class should always be written.
  3. Constructors are normally written in the first code iteration.
  4. An implementation model may be used as a blueprint for coding the core system.
  5. The first round of system testing is usually carried out immediately after the first code iteration is complete.

 

 

 

Question 16

Consider the prototype user interface illustrated in Figure 5. When the user enters the name of a form in the text field, the names of the pupils in that form are displayed in the list. When the user selects a pupil from the list and clicks on the Delete button, the system no longer records the pupil as being in the form. There may be any number of pupils in a form.

Which two of the following statements about this user interface are true?

(Select two options)

  1. A list box would provide a better way of inputting the form.
  2. A set of check boxes would provide a better way of inputting the form.
  3. A set of radio buttons would provide a better way of selecting the pupil.
  4. Relabelling the button as Remove pupil could increase the visibility of the button.
  5. Making the background of the button a bright colour could increase its visibility.

 

 

 

Question 17

 

Which two of the following statements about user interface design are true? (Select one option)

  1. Affordance and visibility are examples of design heuristics.
  2. To draw up an initial widget table the user interface designer must decide how information should flow through the core system to which the user interface will be attached.
  3. Direct manipulation is based on the metaphor of physical manipulation.
  4. An environment that employs a desktop metaphor should offer functionality corresponding exactly to that found on a physical desktop.
  5. The Xerox Star system was an early example of the connection between object-oriented technology and graphical user interfaces.

 

 

Question 18

Which two of the following statements about building a graphical user interface (GUI)

are true? (Select two options)

  1. The first stage in building a GUI is normally to build a textual version of the interface.
  2. The GUI implementor should normally create a separate tabbed screen corresponding to each class in the core system.
  3. One aspect of the GUI implementor’s job is determining which components need to be nested inside other components.
  4. Java’s Swing components have characteristics that are typical of reusable components.
  5. The Java Swing library provides event handling code specifying the actions to be taken in response to the user interacting with the GUI.

 

 

 

Question 19

 

 

Which two of the following statements are true? (Select two options)

  1. A helpful strategy in managing the complexity of a system’s components is to structure the system’s network architecture as a series of tiers.
  2. In a classic three-tiered architecture, the middle tier is normally the coordinating object.
  3. For a system to be structured using a classic three-tiered architecture, it should be implemented using three networked computers.
  4. A system’s logical architecture concentrates on how the system’s major software components are connected and how they interact.
  5. A package diagram may be used to illustrate a system’s logical architecture.

 

 

Question 20

Which two of the following statements are true? (Select two options)

  1. A structural design pattern is one which is concerned with how the objects in a system are initiated.
  2. A coordinating class should be a kind of Façade class.
  3. A coordinating object should be a kind of singleton.
  4. A key feature of a multi-user system is that each computer should be regularly used by more than one person.
  5. The deployment of a distributed system describes the way in which the system is structured into software components.

 

 

 

Part 2

 

Question 21 [20 marks]

A large horse riding stables needs a system to record information about its riding instructors, riders and horses, and about future horse riding lessons (each involving a number of riders) and solo treks. No information about lessons or treks that have already taken place is kept by this system. Here is the relevant part of the requirements document for this system.

System domain

The stables employs several instructors, each of whom is available to give hour -long horse riding lessons. No two lessons can take place at the same date and time. Each lesson is given by one or two named instructors and may be subject to several bookings.

A rider (either a novice or an experienced rider) has to make a booking in advance for a lesson, with experienced riders being able to request a particular horse to ride in the lesson. Each lesson has a limit on the number of bookings that may be made for it. A rider may have no more than eight bookings for lessons.

An instructor may request in advance to make a solo full-day trek, using a particular horse. No more than one such trek may be requested by any instructor.

Use cases

Record new lesson. The stables manager supplies the date, time and booking limit of the new lesson and identifies the instructor(s) who will be giving that lesson.

If there is already a lesson recorded for the given date and time, or if (either of) the instructor(s) has requested a trek for the same date, then the system informs the manager of this.

Otherwise the system records the information about the new lesson.

Record new rider. The manager provides the rider’s name, phone number and date of birth and informs the system whether the new rider is a novice or experienced rider. If the rider is experienced then any riding qualifications the rider holds are also provided. The system records the information about the new rider.

Book lesson. The manager identifies the rider and the lesson. If the rider is experienced then the manager also identifies any horse requested for the booking.

The rider should have fewer than eight existing lesson bookings and should not already be booked for the lesson. The horse (if one is requested) should not be already committed to an existing booking for that lesson or to a trek for the same date.

If the lesson already has its maximum number of bookings then the system informs the manager of this.

If there is space in the lesson the system records the booking for the lesson by the rider and, if relevant, records the horse requested. The system also records the date on which the booking was made.

 

Display trek. The manager identifies the instructor. If the instructor has requested a trek then the system displays the date and proposed route of the trek, along with the name of the horse to be used.

 

  1. Describe how the event of a rider booking a lesson should be modelled in the conceptual model. Briefly explain why the event should be modelled this way.
    Here is an incomplete conceptual model with four classes missing.

 

  1. Copy this incomplete diagram into your answer book. Identify the four missing classes and put their names into the four blank rectangles in your diagram.
     
  2. Now complete the class diagram you began in (b), and write the class descriptions required for a conceptual model for the system. This should involve the classes in Figure 6 above, along with the classes identified in your solution to part (b), and no other classes.
    Your answer should include:
    (i) a complete class diagram;
    (ii) class descriptions (you may omit comments).
     
  3. invariant that should be added to the conceptual model to model the constraint that the number of bookings for a lesson must not exceed that lesson’s booking limit.
  1. State in real-world terms a constraint that is evident from the requirements document and that should be modelled by adding an invariant different to that in (d) above to the conceptual model.

 

 

 

Question 22 [20 marks]

The following is an extract from a structural model for a system to record and display details of the matches played between teams in a local football league. It is incomplete but contains all the information required by this question.

 

  1. It has been decided that the coordinating method for the Record Match use case should return true if neither the home team nor the away team are already recorded as having played a match on the given date, and false otherwise. Write out part of a specification for the coordinating method, as follows. You should use recordMatch as the name of the method and you should give the header (i.e. the return type, method name and any arguments and their type(s)). You should also give a pre-condition. The post-condition is not required.
     
  2. Below is an incomplete walk-through for this scenario of the Record Match use case. Steps 1 to 9 check (a) that team1 and team2 are not equal and (b) that neither team1 nor team2 is linked to any Match object with a date value of 12/09/09. These steps have been omitted since their details are not relevant to this question.
    Provide in your answer book the remaining walk-through steps (10 onwards).

     
  3. Briefly describe a situation mentioned in the description of the Record Match use case that should be addressed by creating a design for an alternative scenario

 

 

 

Question 23 [20 marks]

Below is an extract from an implementation model for an administration system for the Crash Course Driving School which organises driving lessons for its pupils in its cars. A pupil may book ahead for no more than one lesson at a time. No information about lessons which have already taken place is kept by this system.

The implementation model is incomplete but contains all the information required by this question (in particular it doesn't deal with any issues relating to the time lessons take place). It consists of a class diagram and class descriptions, and a dynamic model for a particular use case. It employs the class Name as specified on pages 14 and 15 of the M256 Handbook. It also employs the user-defined types Classification and LessonPupilCar: information about these types is given in parts (a) and (b) of the question.

 

Implementation model

You should skim through this model first to get an overview. Then answer the questions, referring as necessary to the details of the model.

End of implementation model

  1. The instance variable classification in class Car should be restricted to taking values representing the classifications Economy, Standard and MPV only. Specify a suitable type, Classification, for this instance variable.
  2. Below is part of the specification of the user-defined type LessonPupilCar, which is intended to provide a suitable return type for a method specified in the implementation model.

  1.  (i) The following table sets out a test case specification for a test of the method getUnpaidLessonsPupilsAndCars() in the coordinating class DrivingSchoolCoord.

Write code for the body of the test method testGetUnpaidLessonsPupilsAndCars() corresponding to the test case specified in the table above. You are not required to provide Javadoc comments.

Notes:

  • The fixture matches the scenario shown in the object diagram in Figure 11
  • Your test method should set up the fixture itself and, in respect of the classes of the implementation model, should only invoke methods and constructors that are specified in the incomplete implementation model given at the start of the question. You may assume that (except for the method being tested) all methods and constructors specified in the implementation model have already been implemented and tested.
  • You will also need to use the LessonPupilCar constructor specified in part (b).
  • You can use any valid values for attributes that are not specified in the above table
  • Your test method does not need to check that the state of the system is unchanged
     
  1. Write code for the method getUnpaidLessonsPupilsAndCars() of the class DrivingSchoolCoord, based on the dynamic model given above. You are not required to provide Javadoc comments.

 

 

Question 24 [20 marks]

 

  1. This part of the question is about improving an initial prototype graphical user interface (GUI) design for a room-booking application to run on the desktops of the administrators at a community centre. The centre has six meeting rooms and each booking for a room lasts for one hour. Read the descriptions below and then answer the questions that follow.

The initial prototype GUI comprises two screens, as shown below.

 

The Booking Summary screen

This screen is intended to allow bookings and available time-slots for rooms to be displayed and selected. This is done using two tables. For the purposes of this question all you need to know about tables is that they can display information in cells, which are intersections of columns and rows.

The Choose Date table has columns representing days of the week and rows representing dates. The arrow buttons can be used to change the month. Highlighting by clicking is used to select a date, whereupon the bookings information for that date is displayed in the Bookings table below.

The Bookings table has columns representing times in hourly intervals and rows representing room numbers. A cross in a cell represents an existing booking for that room and time on the selected date. Highlighting by clicking is used to select an existing booking or an available time-slot (an empty cell).

Having selected an existing booking or an available time-slot for a particular date, time and room, clicking on the button at the bottom of the screen takes the user to the Make/Edit Booking screen.

The Make/Edit Booking screen

This screen is designed to allow the user to:

  • make a new booking (if an available time-slot was selected in the Booking Summary screen)
  • edit the Activity and/or Contact details of an existing booking (if an existing booking was selected in the Booking Summary screen)
  • delete a booking (if an existing booking was selected in the Booking Summary screen).

All of the widgets on this screen are either buttons or text fields. Both sets of Room, Date and Time text fields are read-only, and their entries are filled in automatically based on selections on the Booking Summary screen. When editing or deleting an existing booking, existing information is also displayed in the editable Activity and Contact fields.

The Save button saves any information about a new or edited booking entered in this screen; the Delete button removes the selected booking and all information about it. The Back to Booking Summary button returns the user to the Booking Summary screen where the creation or deletion of a booking can be checked by consulting the Bookings table.

Some user interface design heuristics (introduced in Unit 12) are listed below.

    • Provide feedback
    • Minimise the users’ memory load
    • Be consistent
    • Allow for undo-ability and commitment
    • Use simple grouping and ordering
    • Prevent errors
  1. Use the design heuristic Prevent errors to identify a fault with the design of the Booking Summary screen and a consequent improvement that can be made to it. Give your answer in the form of a design rationale
  2. Use the design heuristic Use simple grouping and ordering to identify a fault with the design of the Make/Edit Booking screen. Decide on an appropriate improvement, giving your answer in the form of a design rationale.
  3. Choose a design heuristic from the list given above, different from those used in parts (i) and (ii), for which you can identify a fault with the design of one or both of the screens. Give your answer in the form of a design rationale.
  4. Describe briefly the role of user interface prototypes when iteratively developing a system. State one potential disadvantage of implementing sophisticated functional user interface prototypes when developing a system.

 

 

  1. This part of the question is about a Java GUI for a system to handle the appointments booked by clients at a small health spa. A client may book ahead for no more than one appointment (each of which lasts a full day) at a time. No information about appointments that have already taken place is kept by this system.

The GUI will communicate with a core system which is implemented in the package spacore. The core system defines a coordinating class SpaCoord.

              public class SpaCoord{

              }

  1. The GUI will need to use classes from the core system as well as Java’s collection classes and classes from the user-defined package m256date. It will also need to declare an instance variable spa which will be used to reference the coordinating object. Write down the import statements and the instance variable declaration required in the GUI class to achieve this.

    The Appointment Details screen allows the user to initiate the Display Appointment Details use case. Here is a description of this use case.

    Display Appointment Details

    The receptionist identifies a client.

    If the client has an appointment booked the system displays the date, cost and payment status of that appointment (i.e. whether or not the appointment has been paid for) . If the client does not have an appointment booked the system informs the receptionist of this fact.

    It has been decided that the user will select from a scrollable list of the names of clients. If the selected client has an appointment booked the date, cost and payment status of the appointment are displayed in text fields. If the selected client does not have an appointment booked then the user is informed of this in the message area at the bottom of the screen. This is illustrated by the design sketch in Figure 14.

As well as the coordinating class SpaCoord, the core system defines classes Client and Appointment. A Client object represents a client and has an attribute name, representing the name of the client. An Appointment object represents an appointment and has attributes date, cost and paid, representing respectively the date of the appointment, the cost of the appointment and whether or not the appointment has been paid for in advance.

Below are extracts from the Javadoc for some of the methods of these classes

 

  1. Write code for the body of a helper method displayAllClients() for the GUI class. This method should display in the scrollable list the names of all the clients, with the first element in the list selected by default.
    You should assume that:
    • the list is referenced by a variable clientList of type M256JList;
    • when this list is populated with a collection of Client objects the name value of each object will automatically be displayed in the list.

 

  1. Write code for the body of a method to handle the selection of an item from the list. The method should check whether the selected client has an appointment booked. If the client does have an appointment booked, the appointment date, cost and payment status should be displayed in the text fields. If the client does not have an appointment booked an appropriate message should be displayed in the message area. No message should be displayed in the message area if the client does have an appointment booked.

You should assume that:

    • The date field is referenced by a variable dateField of type

JTextField;

    • The cost field is referenced by a variable costField of type JTextField. The cost should be displayed prefixed by a £ sign, for example:

£105.50

  • The payment status field is referenced by a variable paidField of type JTextField. The payment status should be displayed as either:

Yes

or

No

  • The message area is referenced by a variable messageArea of type JTextArea. Messages should take the form of the following example:

Client Fiona Flounder has no appointment booked.

 

 

 

 

 [END OF QUESTION PAPER]

 

Purchase full paper by adding to cart

 

Last updated: Sep 02, 2021 12:38 PM

Can't find a resource? Get in touch

AcademicianHelp

Your one-stop website for academic resources, tutoring, writing, editing, study abroad application, cv writing & proofreading needs.

Get Quote
TOP