Premium Resources

We know the secret of your success

M256/D Software development with Java Undergraduate Level Course Examination 2011

$39.00

PAPER TITLE: SOFTWARE DEVELOPMENT WITH JAVA

DATE: Tuesday, 11 October 2011

 

PART 1

 

Question 1            Which two of the following statements about software development are true?(Select two options)

  1. A predictive approach to software development has the advantage of simplicity of planning.
  2. Using the waterfall method of software development, testing is carried out at each iteration of the development cycle.
  3. Strict adherence to the UML standard is not necessary to allow unambiguous and consistent communication between project members in the modelling and description of the system.
  4. If Java is adopted as the target language in a software development process, then Javadoc can be used to document the development process.
  5. An initial structural model of a system is a static model that illustrates the state of the system at a particular time.

 

ANSWERS(Purchase full paper to get all the solution)

A. A predictive approach to software development has the advantage of simplicity of planning.

DIf Java is adopted as the target language in a software development process, then Javadoc can be used to document the development process 

 

 

Question 2            Which two of the following statements relating to the requirements specification process are true?

(Select two options).

  1. The stakeholders in a requirements elicitation process include the clients, the end users and the analysts, but not the designers or programmers of the system, whose role arises only as a result of the establishment of requirements.
  2. Elicitation and analysis are two distinct phases in the preparation of a requirements document: first the analyst consults with the client to understand what the client requires and then the analyst distils the information into a clear and coherent description of the system and its required behaviour.
  3. The requirements document describes areas such as the scope of the system, tests that the system provides the required behaviour, constraints on the system and project management information.
  4. Requirements creep can be avoided by employing a methodology of iterative prototyping.
  5. Use cases are descriptions of specific tasks that a user of the system should be able to make the system perform.

 

 

Question 3            Which two of the following statements relating to the requirements specification process are true? (Select two options)

  1. In the elicitation process the analyst should ignore a client's description of constraints on the system that are not behavioural requirements as these are factors that should be considered in the design phase of development.
  2. The following is an example of a constraint that is not a behavioural requirement:

‘The Discharged Patients report should be printed on a separate page for each ward in the hospital.'

  1. The following is an example of a behavioural requirement:

'It should be possible for the hospital reports to be output in PDF format.'

  1. The following is an example of a behavioural requirement:

'Patients listed in the Discharged Patients report should be grouped by the consultant who treated them.'

  1. The following is an example of a constraint that is not a behavioural requirement:

'A hospital report should be accessible from any of the terminals in the hospital within 500 milliseconds of its being requested'.

 

 

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

  1. The initial structural model is a model of the system domain whereas the conceptual model is used as the first model of the system itself.
  2. If classes X and Y are specialisations of class Z, then class Z has a generalisation relationship with classes X and Y.
  3. A relationship that is not a generalisation and involves three or more classes can be modelled by a single class that has associations with each of the classes involved in the relationship.
  4. If every object of a class A is linked by a particular association to an object of class B, then A is said to specialise B.
  5. A recursive association is one where an object of one class may be linked to more than one object of another class.

 

Question 5            Which two of the following statements can be deduced from the given information and class diagram in Figure 1? (Select two options)

  1. The multiplicity of the isMemberOf association at the Department end should be 0..1.
  2. The multiplicity of the isMemberOf association at the Department end should be 1..*.
  3. The multiplicity of the isMemberOf association at the Department end should be 1.
  4. The multiplicity of the isMemberOf association at the Teacher end should be 0..*.
  5. The multiplicity of the isMemberOf association at the Teacher end should be 1..*.
  6. The multiplicity of the isMemberOf association at the Teacher end should be 2..*.

 

 

 

Question 6            Based on the information in the panel labelled Figure 1, which two of the following statements are true? (Select two options)

 

  1. The class Teacher should be labelled as an abstract class.
  2. There is a redundant relationship between the classes Teacher and

Lecturer.

  1. The class Department should be labelled as an abstract class.
  2. The following is an invariant that is required in addition to the class diagram, as part of the initial structural model:

Each Department object is linked via isHeadedBy to a Professor object.

  1. The following is an invariant that is required in addition to the class diagram, as part of the initial structural model:

The Professor object linked to a Department object via isHeadedBy is linked to the same Department object via isMemberOf.

  1. The following is an invariant that is required in addition to the class diagram, as part of the initial structural model:

A Department object linked via isMemberOf to a Professor object is linked to the same Professor object via isHeadedBy.

 

 

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

  1. A method's post-condition states what the method must achieve regardless of whether the pre-condition is satisfied or not.
  2. Data hiding provides a basis for the independence of classes and the protection of the integrity of instances of classes.
  3. It may be possible to identify some of a Java method’s pre-conditions from the Javadoc specification of the exceptions that the method throws.
  4. A Javadoc specification of a method must document the method’s implementation details so that the user knows how to make use of the method.
  5. In Java, the protected access modifier is also referred to as the default access modifier.

 

 

Question 8            Which two of the following statements about component based software development are true? (Select two options)

  1. An aim of good design is to maximise the coupling of components within a package.
  2. Cohesion is a measure of the extent to which a component is dependent on other components.
  3. Polymorphism facilitates the replacement of one class in a system with another.
  4. When a class, P, is reused by composition by another class, Q, this is achieved by each instance of Q having an instance of P as part of its state.
  5. Since composition involves coupling, it is preferable where possible to associate two classes by inheritance.

 

 

 

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

 

  1. In object-oriented software development, encapsulation refers to protecting an object’s implementation details by restricting access to them.
  2. In Java, to ensure data integrity, all the instance variables of a class should be declared private and public setter and getter methods should be provided for each of them.
  3. The use of defensive copies of immutable objects is a strategy employed to prevent privacy leaks.
  4. Writing suitable setter methods can help prevent some invariants from being broken.
  5. A user interface is highly coupled with a coordinating object and a coordinating object is highly coupled with the rest of the core system.

 

 

Question 10          Two message answers, message answer 1 and message answer 2, are missing from the sequence diagram in Figure 2. Which one of the following statements correctly describes the missing message answers? (Select one option)

  1.  message answer 1:
    {trainer2, trainer5 }
    message answer 2:
    {(activity3, trainer2), (activity9, trainer5)}
     
  2.  message answer 1:
    {member28, (activity3, trainer2), (activity9, trainer5)}
    message answer 2:
    {member28, (activity3, trainer2), (activity9, trainer5) }
     
  3.  message answer 1:
    {(activity3, trainer2), (activity9, trainer5) }
    message answer 2:
    {(activity3, trainer2),(activity9, trainer5)}
     
  4.   message answer 1:
    {{activity3, activity9}, {trainer2, trainer5}}
    message answer 2:
    {{activity3, activity9}, {trainer2, trainer5}}

 

 

Question 11          Which two of the following statements could be a correct identification of the walkthrough steps indicated by the notes X, Y and Z in the sequence diagram in Figure 2? (Select two options)

  1. X is Step 1; Y is Step 2; Z is Step 4
  2. X is Step 2; Y is Step 3; Z is Step 5
  3. X is Step 1; Y is Step 3; Z is Step 4
  4. X is Step 2; Y is Step 3; Z is Step 4
  5. X is Step 1; Y is Step 2; Z is Step 3

 

 

Question 12          On the basis of the information in Figure 2, which two of the following statements are true? (Select two options)

  1. A method whose specification begins as follows is appropriate for the protocol of GymCoord:

Collection getActivitiesAndLeaders(Member aMember)

  1. A method whose specification begins as follows is appropriate for the protocol of GymCoord:

Map getActivitiesAndLeaders(Member aMember)

  1. A method whose specification begins as follows is appropriate for the protocol of Member:

Trainer getLeader()

  1. A method whose specification begins as follows is appropriate for the protocol of Activity:

Trainer getLeader()

  1. A method whose specification begins as follows is appropriate for the protocol of Trainer:

Trainer getLeader()

 

 

Question 13          Which two of the following statements relating to detailed design are true? (Select two options)

  1. Enumerated types in Java are used to implement sorted sets of numbers.
  2. Refactoring can result in the creation of additional classes.
  3. The Java documentation for the toString() method in class Object recommends that where toString() is overridden, compareTo() and hashCode() are overridden to be consistent with toString().
  4. No two distinct and unequal objects should ever have the same hashcode.
  5. If an instance variable references an immutable object, it may be possible to change the value of that instance variable.

 

Question 14          Which two of the following statements about implementing and testing object-oriented software are true? (Select two options)

  1. Acceptance testing involves verification that all aspects of a system and its project documentation are consistent and complete with respect to each other.
  2. Black box testing involves the examination of a method’s code to validate it against customer requirements.
  3. In unit testing a boundary value can be defined as a point at which the software’s specification indicates that there should be a change in the behaviour.
  4. The process of rerunning previous tests to check that a change to one aspect of a system has not damaged another is known as integration testing.
  5. A test driven approach to the implementation stage of development is compatible with a use case driven approach.

 

 

Question 15          Consider the following sequence diagram.

Figure 3

 

On the basis of Figure 3, which two of the following options represent an appropriate order in which the methods involved should be implemented? (Select two options)

A.

1. register(aStudent, aCourse)

2. hasReserved(aStudent)

3. addStudent(aStudent)

4. addCourse(aCourse)

B.

1. addCourse(aCourse)

2. addStudent(aStudent)

3. hasReserved(aStudent)

4. register(aStudent, aCourse)

C

1.   hasReserved(aStudent)

2. addCourse(aCourse)

3. addStudent(aStudent)

4. register(aStudent, aCourse)

  1.  
  2.  

D.

??????1. hasReserved(aStudent)

    1. addStudent(aStudent)
    1. addCourse(aCourse)
    1. register(aStudent, aCourse)

 


  1. 1. addStudent(aStudent)
    1. addCourse(aCourse)
    1. hasReserved(aStudent)
    1. register(aStudent, aCourse)

 

 

Question 16          Which two of the following statements about user interface design principles are true? (Select two options)

 

 

  1. Visibility refers to the extent to which the way a widget should be manipulated is apparent.
  2. Affordance refers to the manipulations that a widget appears to allow.
  3. User interface metaphors can enhance the visibility of widgets by exploiting the familiar mental models of users.
  4. Efficiency, in the context of a user interface, is a measure of how well the interface enables the user to get the right thing done.
  5. If a widget is easy to see, it follows that it has good visibility.

 

 

Question 17          Which three of the following statements about user interface design are true? (Select three options)

  1. The object oriented concept of polymorphism is related to the usage of universal commands in interfaces for different applications.
  2. ’Design for all’ advocates that all users should be encouraged to participate in user interface design.
  3. WYSIWYG systems allow continual feedback on user commands.
  4. Functionality refers to the extent to which a system can be used to achieve goals effectively and efficiently.
  5. User-centred design is focused on optimising the satisfaction of all users of an interface.
  6. Learnt affordance takes into account the effect of a user’s background and experience on their use of a widget.

 

 

Question 18          Which two of the following statements about building graphical user interfaces are true? (Select two options)

  1. Listeners are Java objects that are attached to interface components to initiate the handling of user interactions with the interface.
  2. Persistence refers to the ability of a system to recover from errors and is made possible by exception handling code.
  3. A coordinating object acts as a client to other core system objects and a server to the interface objects within a GUI application.
  4. An aim of user interface design is to reduce the dependencies between a user interface and the core system within an application.
  5. The core system must have a reference to some object in the GUI.

 

 

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

  1. The term computer architecture is normally used to refer to the way that different computers involved in a system are connected.
  2. A UML package diagram can be used to illustrate a perspective of the logical architecture of a system but need not correspond to the eventual structure of the implemented system.
  3. The business domain tier is the most appropriate place to locate the management of concurrent access in a tiered architecture.
  4. A design pattern is a language-independent generalised abstraction of a SOLUTION to a problem and its appropriate application should ensure that software adheres to relevant design principles.
  5. The Singleton pattern is an example of a behavioural design pattern.

 

 

 

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

  1. Waterfall software development methods typically produce a series of prototypes, giving the client opportunities to ‘see’ what is being developed throughout the process.
  2. The Rational Unified Process is a description of a number of methods of software development using the UML.
  3. Timeboxing is the practice of isolating untested code from working prototypes until the next iteration of the development cycle.
  4. The Dynamic Systems Development Method is a form of development that makes use of the timeboxing technique.
  5. The term agile software development refers to the development of software that needs to quickly adapt to changing user requirements when the software is in operation.

 

 

PART 2

Question 21 (20 marks)

A holiday company needs a system to record information about its Mediterranean cruises over the course of a single summer. No other historical or future information needs to be kept. Here is the relevant part of the requirements document for this system.

System domain

The company has several ships and runs many summer-long Mediterranean cruises each year. Each cruise uses a single ship and each ship is used by exactly one cruise each summer.

Every ship has a unique name (e.g. ‘Destiny’) and has between one hundred and three hundred cabins, which are of two different kinds:

  • grand suites (each of which can accommodate up to four passengers and may or may not have a balcony);
  • standard cabins (each of which can accommodate up to six passengers and may or may not have a sea view).

There is no minimum number of passengers on a cruise. A passenger goes on precisely one cruise each summer.

Each cruise offers at least twenty day -long excursions to a number of Mediterranean ports. Each excursion on a particular cruise is to a different port, but a port can be used for excursions by a number of different cruises. Each excursion is offered by a single cruise and has a limit on the number of passengers from that cruise who may join it. For each excursion the passengers on the cruise may each opt to join the excursion (so long as the excursion’s limit is not exceeded).

Use cases

Display cruise’s passengers. The administrator identifies a cruise. The system displays the name of the ship used by that cruise and, for each passenger on that cruise, the name and address of the passenger and the number of the ship’s cabin in which the passenger resides.

Display cruise itinerary. The administrator identifies a cruise. The system displays the start date of the cruise, the name of each port that the cruise will offer an excursion to, and the date of the excursion.

Record passenger’s excursion. The administrator identifies a passenger and an excursion. The excursion must be offered by the cruise that the passenger is on.

If the excursion’s passenger limit has been reached then the system informs the administrator of this.

Otherwise the system records that the passenger is joining the excursion.

  1. Explain why it is not necessary to use a class to model the event of a passenger joining an excursion.(2 marks)

Figure 4 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 marks)

  1. 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 4 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  (8 marks)

(ii)        class descriptions (you may omit all comments). (5 marks)

  1. State an invariant that should be included in your conceptual model to model the constraint that a passenger who joins an excursion must be on the cruise which offers that excursion. (2 marks)

e.    State in real-world terms a constraint that is evident from the requirements document and that should be modelled by including an invariant different to that in (d) in your conceptual model. The constraint should not be related to the uniqueness of attribute values. There are several such constraints; only one is required. (1 mark)

 

 

Question 22 (20 marks)

This question is about developing a system concerned with reservations for tables in a chain of restaurants.

Each reservation is made by a customer for a table in a restaurant. A customer may have no more than one reservation for a particular date. No more than one reservation may be made for a particular table on any date. When a customer arrives at a restaurant in which they have reserved a table for the current date all details of the customer’s reservation are destroyed, but a record is kept of the fact that the customer has eaten at the restaurant.

The following is an extract from a structural model being developed for this system. Only attributes that might be relevant for this question are shown in the class descriptions.

The following object diagram shows the relevant objects and links for a particular scenario of this use case, before the use case is initiated.

 

 

Purchase full paper by adding to cart

 

 

Last updated: Sep 02, 2021 12:27 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