MID Exam UML

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

1.

Which of the following statements is true about a prototype


system?
a.A prototype system is always discarded before the final production
system is built.
b. Rapid development tools are only used to build prototype systems.
c.A prototype system is incomplete or lacks the resilient construction of the
final production system.

2. Given:
import java.sql.*;
public class ConnectClass
{ public Connection con; public Statement st; public ResultSet rs;
public ConnectClass()
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:swingpro"); st =
con.createStatement();
}catch(SQLException ex)
{
System out println("Connection error"):
When this program prints “Connection error2†?

a. if the Statement object is not created


b. if ResultSet interface is not imported
c. if executing statement does not find database table
d. if the JDBC driver is not loaded

3. Both actions and activities may be tied to a state.


a. The entry and exit actions, if present, are triggered.
b.The entry and exit actions are not triggered.
c.The entry and exit actions if present and the action tied to the internal
transition are all triggered.
5. Data about data is called
a. Database
b.Data dictionary
c. Database catalog

6. Which of the following best describes when primary operations should


be shown on class diagrams?
a. All primary operations are shown on class diagrams in design.
b. Primary operations are shown in class diagrams only if they modify
attribute values.
c. Primary operations are shown on design class diagrams if they are part
of the public interface of the class.

7. Which of the following encapsulates an SQL statement which is passed


to the database to be parsed, compiled, planned and executed
a. DriveragerJD
b.BCdrive
c. Connection
d.Statement

8. Which of the following syntax is correct to load JDBC-ODBC driver?


a.Class.callName("sun.jdbc.odbc.JdbcOdbcDriver");
b.Class.callfunc("JdbcOdbcDriver");
c.Class.Name.init("sun.jdbc.odbc.JdbcOdbcDriver");
d.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

9. Which of the following are purposes for using Component


diagrams?
a. Component diagrams can also be used as a static implementation view
of a system
b. Component diagrams are used to represent the working and behavior of
various components of a system.
c.a & b
d.none

11. What is true about Software Maintenance?


a. Modify and update after it has been delivered to the customer.
b. Modify and update before it has been delivered to the customer
c. All

12. When a statechart is checked for consistency with other models of the
system which of the following is true?

a.Every operation in a class must appear as an event on a statechart.


b. Every action should correspond to the execution of an operation on the
appropriate class.
c. Every event must appear on a sequence diagram.

13. Which of the following is claimed as an advantage of iterative


development processes?

a.Risk mitigation — by identifying technical problems early on.


b. Logical design —by producing a design that is not tied to the physical
implementation.
c. Diagram separation —by making it possible to use different kinds of
diagrams in analysis from those used in design.

15. Which of the following is correct about JDBC?


a. The JDBC API provides the abstraction and the JDBC drivers provide the
implementation.
b. new drivers can be plugged-in to the JDBC API without changing the
client
code.
c. Both of the above.

16. How many levels in Testing?


a.Three
b. Two
c. Four

17. Suppose a prepared statement is created as follows:

Statement preparedStatement = connection.prepareStatement ("insert


into Student (firstName, mi, lastName) " +"values (?, ?, ?)");
To set a value John to the first parameter, use
a. preparedStatement.setString(0, "John");
b.preparedStatement.setString(1, "John");
c. preparedStatement.setString(0, 'John');
d.preparedStatement.setString(1, 'John');

18. Which of the following is more efficient than a statement due to


pre-compilation of SQL?
a. Statement
b. PreparedStatement
c.CallableStatement
d. None of the above.

19. Choose the correct one relating to the PreparedStatement?


a. We use it in compile time.
b.PreparedStatement is not an extension of Statement
c.We can perform the same operation multiple times using
PreparedStatement.
20. Which of the following is a beneficial consequence of good cohesion
in a class?
a. The attributes in the class will only be accessed by the operations of that
class.
b.The class will exhibit high levels of encapsulation.
c.The operations in the class will be easier to maintain.

21. What is the difference between a link and an association?


a.A link connects two instances, while an association connects two classes
b. A link is a transient association
c.A link is an association between two entity classes.

22. Which of the following statements is true about actions and activities?
a. An activity may be tied to a transition.
b. An action may only be tied to transitions.
c.Both actions and activities may be tied to a state.

23. “The ability of different methods to implement the same operation


in different ways those are appropriate to its class†This statement is
about
a. Inheritance
b.Generalization
c. Specialization
d.Polymorphism

24. Which of the following is a description of logical design?


a. Design of aspects of the system without having to consider how they will
physically be implemented.
b. Design of the logic used in operations, based on decision trees, decision
tables or Object Constraint Language.
c. Design of the logic gates used in the implementation of the processor
chips used in the system.
25. Which of the following can be treated as Functional Requirements?
a. Requirements those describe what a system must do
b.Requirements those are concerned with how well the system
c.Requirements those are concerned with matching the system to the way
that people work
d. All of the above

26. Which of the following is true?


a. A state is never transitory, it always lasts for an interval of time.
b. A state is a condition during the life of an object or an interaction during
which it satisfies some condition.
c. An object always has more than one potential state.

29. Choose the correct one relating to the PreparedStatement ?


a. We use it in compile time.
b.PreparedStatement is not an extension of Statement
c. We can perform the same operation multiple times using
PreparedStatement.

31. Which of the following might provide a measure of the usability of a


system?
a. The number of errors made by programmers.
b. The number of errors made by users.
c. The number of bugs found by system testers.

32. If you want to see a list of all authors and the books, which of the
following statements is correct?

a. Select a.lastname, a.firstname,b.title from authors a, books b,


auth_books ab where a.authid=ab.auth_books ab where
a.authid=ab.authid
b. Select a.lastname, a.firstname,b.title from authors a, books b,
auth_books ab where a.authid=ab.auth_books ab where a.authid-ab.authid
and b.isbn=ab.isbn
c. None

33. Which of the following is correct about JDBC?

a. The JDBC API provides the abstraction and the JDBC drivers provide the
implementation.
b. new drivers can be plugged-in to the JDBC API without changing the
client code.
c. Both of the above.

34. Which of the following statements is true about the Composite


pattern?

a. The pattern must be used in conjunction with the Singleton pattern.


b. The pattern makes it easier to add new leaf subclasses.
c. The pattern makes it easier to add new operations to each of the leaf
subclasses.

35. Which of the following is a description of logical design?


a. Design of aspects of the system without having to consider how they will
physically be implemented.
b. Design of the logic used in operations, based on decision trees, decision
tables or Object Constraint Language.
c. Design of the logic gates used in the implementation of the processor
chips used in the system.

37. Which of the following is not a reason for separating the analysis
stage from the design stage?
a. Analysts and designers may be people with different skills and
knowledge.
b. It is not possible to begin design until all the analysis has been
completed.
c. clients will want clear decision points at which they can agree that the Go
to Settings to activate Time Elapsed progress to the next stage and incur
further costs.

38. Which of the following best describes when primary operations should
be shown on class diagrams?

a. All primary operations are shown on class diagrams in design.


b. Primary operations are shown in class diagrams only if they modify
attribute values.
c. Primary operations are shown on design class diagrams if they are part
of the public interface of the class.

39. Which of the following is not an advantage of the State pattern?

a. State behavior is localized.


b. The Singleton pattern may be used with the State pattern.
c. State transitions are made explicit.

40. When is a UML interface used?


a. It describes boundary classes.
b. It describes an interface that a class may offer to another class.
c. It describes the human-computer interface

41. UML consists mainly of ________ to represent concepts of an Object


Oriented Information System. Pick the most appropriate one for the blank
space.

a. A icon
b. A symbol
c.A textual language
d.A graphical language

42. Most JDBC methods handle errors by throwing exceptions of What


type?

a.ClassException
b.SQLException
c. SQLWARNING

43. A statechart may have states that include substates. Which of the
following is true?

a.An object may occupy more multiple concurrent substates


simultaneously.
b.An object may occupy only two concurrent substates simultaneously.
c.An object may only occupy one substrate at a time.

44. Which of the following are UML implementation diagrams?

a. Component diagrams
b.Deployment diagrams
c.All

45. Which of the following is not part of detailed design?


a. Screen and window layouts in the form of user interface classes.
b.Allocation of subsystems to processors.
c. Allocation of responsibilities to classes

46. Which of the following is correct about connection pooling?


a. Database vendor's help multiple clients to share a cached set of
connection objects that provides access to a database.
b. Clients need not create a new connection
c.Both of the above.

47. Which of the following statements is correct?


a. You may load multiple JDBC drivers in a program.
b. You may load only single JDBC drivers in a program.
c. Both A and B

48. Which of the following is a list of characteristics of good design?


a. Consistency, efficiency, effectiveness and correct scope.
b.Efficiency, reliability, security and flexibility.
c. Efficiency, redundancy, functionality and usability.

49. What is meant by an economical design?


a. The design itself was produced at a low cost.
b.The fixed costs and running costs of the system will be low.
c. The system will use inexpensive disks.

53. Which of the following statements is true about a prototype system?


a.A prototype system is always discarded before the final production
system is built.
b.Rapid development tools are only used to build prototype systems.
c.A prototype system is incomplete or lacks the resilient construction of the
final production system.

54. Which of the following best describes how composition differs from
aggregation?

a.A part cannot be removed from a composition, whereas a part can be


removed from an aggregation.
b. A part can belong to only one composition, whereas a part can belong to
more than one aggregation.
c.A part that belongs to a composition cannot have associations with any
other classes, whereas a part that belongs to an aggregation can have
associations with other classes

56. Which of the following is a beneficial consequence of good cohesion


in a class?
a.The attributes in the class will only be accessed by the operations of that
class.
b. The class will exhibit high levels of encapsulation.
c. The operations in the class will be easier to maintain.

59. Which of the following syntax is correct to load JDBC-ODBC drivers?


a.Class.callName("sun.jdbc.odbc.JdbcOdbcDriver");
b.Class.callfunc("JdbcOdbcDriver");
c.Class.Name.init("sun.jdbc.odbc.JdbcOdbcDriver");
d.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

60. What is meant by a secure design?


a.The design is held in encrypted format in a CASE tool repository.
b.The models are backed up nightly and the back-up stored off-site.
c.The design includes measures to protect the system from deliberate or
inadvertent damage.

61. UML consists mainly of representing concepts of an Object Oriented


Information System. Pick the most appropriate one for the blank Q space.
a.A icon
b. A symbol
c.A textual language
d.A graphical language

63. Which of the following encapsulates an SQL statement which is


passed to the database to be parsed, compiled, planned and executed
a. Driverager
b.JDBCdriver
c.Connection
d. Statement

64. Choose the correct one relating to the PreparedStatement ?


a.We use it in compile time.
b. PreparedStatement is not an extension of Statement
c.We can perform the same operation multiple times using
PreparedStatement.

65. Which of the following is a list of characteristics of good analysis?


a. Completeness, consistency, correct scope and correct content.
b.Consistency, security, reliability and completeness.
c. Consistency, efficiency, effectiveness and correct scope.

67. Which of the following is more efficient than the statement due to
pre-compilation of SQL?
a. Statement
b.PreparedStatement
b.CallableStatement
c. None of the above.

72. What is meant by the term †̃measurable objectivesâ€TM?


a.Aims of the system that are vague and difficult to assess.
b. Objectives that can be quantified and have a specific numeric target.
c.Strategic aims of the organization that is getting a new system.

74. Which of the following is more efficient than the statement due to
pre-compilation of SQL?
a. Statement
b.PreparedStatement
c.CallableStatement
d.None of the above.

75. What is system design?


a. Designing the architecture of the system and setting standards, for
example for user interface design.
b.Designing the inputs and outputs of the system, processes and data
storage.
c.Designing classes that will implement the system in an object-oriented
language.

76. What is the Final stage of Testing?


a. Alpha Testing
b.User Acceptance
c. Beta Testing

78. Which of the following is not a characteristic of a maintainable


design?
a.The developed program code and the design model are kept in sync.
b.The design and program code are well documented.
c.The code is designed to require maintenance work equivalent to 60% of
all staff time

79. Encapsulation is best enforced by which of the following decisions


regarding object visibility?
a. All attributes and operations are private.
b.All attributes are private and all operations are public.
c.All attributes are private and public operations are kept to a minimum.

81. Which of the following methods is used to move the cursor to the next
position?
a.first()
b.last()
c.movecursor()
d.next()

82. Most JDBC methods handle errors by throwing exceptions of What


type?
a.ClassNotFoundException
b.SQLException
c.SQLWARNING

83. Which one is considered a strong association?


a.Composition
b. Aggregation

84. Patterns are grouped into-


a.Catalogues
b. Languages
c.Framework
d.A & B

85. Which of the following is correct about connection pooling?


a.Database vendor's help multiple clients to share a cached set of
connection objects that provides access to a database.
b.Clients need not create a new connection every time to interact with the
database.
c.Both of the above.
d.None of the above.

86. Which of the following is Behavioural Patterns?


a. Singleton Pattern
b.State Pattern
c. Composite Pattern

88. Choose the correct answer?


a. executeQuery method is used for create, insert and modify statements
b.executeUpdate method is used for Select statement
c.None.

89. What do boundary classes represent?


a.Customers and suppliers of the business.
b.People who will use the system.
c.Interaction between the system and its actors.
d.None of the above.

90. Which of the following is Creational Patterns?


a.Singleton Pattern
b.State Pattern
c.Composite Pattern

95. Which of the following is correct about JDBC?


a. The JDBC API provides the abstraction and the JDBC drivers provide the
implementation.
b.New drivers can be plugged-in to the JDBC API without changing the
client code.
c.Both of the above.
96. Which can reduce the time required to develop and test a design?
a.Software components
b.Design components
c.Analysis components
d. All of the above

97. A guard condition may be associated with a transition. Which of the


following statements best applies to guard conditions?
a. A guard condition may only involve attributes of the object that owns the
statechart.
b. A guard condition may involve attributes and links of the object that
owns the statechart.
c. A guard condition may only involve parameters from the triggering event.
99. When an object exits a composite state which of the following is true.
a. Each of the submachines in the composite state must enter their final
state.
b.At least one of the submachines in the composite state must enter its
final state.
c. Whatever combination of substates the composite is in, all those
substrates are excited.

102. How does generalization differ from inheritance?


a. It doesn't - they are the same thing.
b. Inheritance is a mechanism by which some OO languages implement
generalization.
c. With generalization each class has only one super class, whereas with
inheritance each class has two or more super classes.

103. Given:
import java.sql.*;
public class ConnectClass
{ public Connection con;
public Statement st;
public ResultSet rs;
public ConnectClass()
{
try{

a.if object is not created


b.if ResultSet interface is not imported
c. if executing statement does not find database table
d.if the JDBC driver is not loaded

104. The transition from one state to another is triggered by an event. One
type of event is a change event. Which of the following statements is true?
a.A change event occurs when a condition becomes true.
b.A change event occurs when a condition changes.
c.A change event occurs when an attribute value changes in an object.

107. Good coupling is best characterized by which of the following?


a. Keeping the number of message types between objects to a minimum.
b. Ensuring that sub-classes are not strongly linked to their superclass.
c.Ensuring that operations in the same class are linked.

109. How many collection classes could sensibly be used to implement a


two-way many-to-many association?
a.Two or more.
b.Two.
c.One.

111. What is “estate†of an object?


a.The condition of an object at a given moment
b.What the object can do
c.How an object responds to events
d.Uniqueness of an object

114. Which of the following is not an advantage of the State pattern?


a.State behavior is localized.
b.The Singleton pattern may be used with the State pattern.
c.State transitions are made explicit.

117. What is the purpose of Testing?


Identifying any errors
Check gaps or missing requirement
All
119. Suppose a prepared statement is created as follows:
Statement preparedStatement = connection.prepareStatement
("insert into Student (firstName, mi, lastName) " +"values (?, ?, ?)");
To set a value John to the first parameter, use

preparedStatement.setString(0, "John");
preparedStatement.setString(1, "John");
preparedStatement.setString(0, 'John');
preparedStatement.setString(1, 'John');

120. Which statement is an example of logical design?


a. Communication between the Agate system and the company
accounts system will be by passing messages.
b. There will be a message sent to the accounts system called
NewInvoice, which will be formatted in XML, and each invoice will
have a six-digit invoice number allocated by the accounts system.
c. Communication between the Agate system and the company
accounts system will use the OpenJMS Java message server with
persistent storage of messages provided by the MySQL
database.
122. What are the three analysis class stereotypes?
a. Boundary
b. Control
c. Entity
d. Interface
e. A, B & C

123. Which of the following encapsulates an SQL statement which is


passed to the database to be parsed, compiled, planned and executed
DriveragerJD
BCdrive
Connection
Statement
124. When objects are being designed in detail the signature of each
operation has to be specified. Which of the following statements is
consistent with the term operation signature?
a. Each operation in a class has the same signature.
b. The operation name and the number of parameters are part of the
operation signature.
c. A class may not have two operations with the same name.

125. Which of the following is not one of the categories defined for the
GOF patterns?
a. Creational
b. Static
c. Behavioral
127. Most JDBC methods handle errors by throwing exceptions of What
type?
ClassNotFoundException
SQLException
SQLWARNING

128. If you want to see a list of all authors and the books, which of the
following statements is correct?
Select a.lastname, a.firstname,b.title from authors a, books b, auth_books
ab where a.authid-ab.auth_books ab where a.authid=ab.authid
Select a.lastname, a.firstname,b.title from authors a, books b, auth_books
ab where a.authid-ab.auth_books ab where a.authid-ab.authid and
b.isbn=ab.isbn
None

133. When is a UML interface used?


a. It describes boundary classes.
b. It describes an interface that a class may offer to another class.
c. It describes the human-computer interface
134. Data about data is called
Database
Data dictionary
Database catalog

135. Which of the classes store the logical set of columns and rows of
data returned by executing a statement?
a. Statement
b. Meta data
c. Connection
d. Resultset

136. Choose the correct one relating to the PreparedStatement?


We use it in compile time.
PreparedStatement is not an extension of Statement
We can perform the same operation multiple times using
PreparedStatement.

137. Which of the following is not part of detailed design?


a. Screen and window layouts in the form of user interface classes.
b. Allocation of subsystems to processors.
c. Allocation of responsibilities to classes

138. How many levels in Testing?


a. Three
b. Two
c. Four

142. What is meant by design trade-offs?


a. A way of resolving conflicts between requirements and design
constraints.
b. A way of achieving measurable objectives in design.
c. A way of producing reusable code.
143. Which of the following best describes when primary operations
should be shown on class diagrams?
a. All primary operations are shown on class diagrams in design.
b. Primary operations are shown in class diagrams only if they modify
attribute values.
c. Primary operations are shown on design class diagrams if they are
part of the public interface of the class.

145. Which of the following statements is true about actions and


activities?
An activity may be tied to a transition.
An action may only be tied to transitions.
Both actions and activities may be tied to a state.

147. When this program prints “Connection error2�


if the Statement object is not created
if ResultSet interface is not imported
if executing statement does not find database table
if the JDBC driver is not loaded

148. What is “estate†of an object?


The condition of an object at a given moment
What the object can do
How an object responds to events
Uniqueness of an object

153. Which of the following is not one of the categories defined for the
GOF patterns?
a. Creational
b. Static
c. Behavioural
155. Which combination of cohesion and coupling is desirable in a
design?
a. High cohesion and low coupling.
b. High cohesion and high coupling.
c. Low cohesion and high coupling.

156. Choose the correct answers? (Choose all that apply)


a. To commit a transaction, call the method commit on appropriate
connection.
b. Use the method rollback to remove changes since the last commit
c. By default all new connections are in auto commit mode.
d. All of the above.

158. Which of the following are purposes for using Component diagrams?
a. Component diagrams can also be use as a static implementation
view of a system
b. Component diagrams are used to represent the working and behavior
of various components of a system.
c. a & b
d. none

164. The behavioral approach to constructing statecharts involves which


of the following?

a) All collaboration sequence diagrams should be analyzed first.

b)All interaction sequence diagrams involving classes that have heavy


messaging should be analyzed.

c)One interaction sequence diagram for each class must be analyzed.

166. Which of the following statements best describe the application of


referential integrity during object design?
a)An object may only refer to another object if they share a link.

b)when an object is deleted all objects to which it refers must be deleted.

c)Referential integrity only applies for one-to-one associations.

170. Which of the following is the best description of a design model?

a)It shows what the system will do.

b)It shows how the system will work.

c)It shows why the system is required.

176. Which of the following might provide a measure of the usability of a


system?

a) The number of errors made by programmers.

b) The number of errors made by users.

c)The number of bugs found by system testers.

184. Deployment diagrams are used to show the configuration of run –
time processing and physical architecture of the system.

a) True

b)False

You might also like