Final Exam - Object Oriented Programming
Final Exam - Object Oriented Programming
FINAL EXAMINATION
OOP310: Object-Oriented Programming
NAME: ___________________________________
DATE: _______________________
INSTRUCTOR: _________________
GENERAL INSTRUCTIONS:
Write your name, section, date and instructor on the questionnaire and answer sheet
Avoid too much erasure.
For True/False type, shade [A] if the statement is true otherwise [B] if false.
For Multiple choice type, shade the letter that correspond to your answer.
Write your answers on the answer sheet provided
Use black- or blue-inked pen only
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
The _______________method is a member of the Console class in the System namespace which is used to display
messages, results or values on the screen. It includes a carriage return and a linefeed, which makes the cursor
move to the next line.
The method_______, is a .NET method that is used to convert a numeric data type to the string data type.
The _____________________ (%) is used to get the remainder of division.
The _______ assignment operator is used for assigning a value, expression, or variable to a variable.
.NET method __________ can get the type name of any local variable or object.
____ suffix is added for decimal type.
____ suffix is added for float type.
The nullable variable is declared by using the ____ symbol next to the type name
Use the _____ operator to assign a default value that will be applied when a variable with the value null is
assigned to another variable.
If you would like to modify the contents of the actual string, use the _______class.
The equality operator _________ is used to determine if two strings are identical.
The ____ operator is used to access the individual characters of a string.
With the ____ symbol you can display any string without using the escape characters inside the string.
To read input from the keyboard, use the .NET method ____________. It reads anything you type in the command
line before you press the Enter key.
A string read from the keyboard can be converted to any type of data by using the conversion methods. The class
______ belongs to the System namespace. You can use it to convert a string to another type, such as an integer,
double, etc.
Another way to convert strings to numbers is by using the _____ method, one of the .NET methods.
The _________ operators (or comparison operators) are used in building relational (or Boolean) expressions to
compare literals, variables, or expressions.
__________ operators are used to combine relational expressions to build a logical (or Boolean) expression.
The ______ construct is used to select from multiple choices, such as selecting a floor in an elevator, an item from
a vending machine, or a choice from a menu.
A(n) ______ is a data structure that represents a group of elements of the same type and each elements can be
access through its indexes.
The array elements might be arrays themselves, in which case the array is called a ______or an array of arrays.
The array's property is the number of dimensions of an array.
The _______ method is used to sort an array.
The _______method is used to reverse an array.
The ________method, which is used to change the size of an array.
The opening left bracket ([) and closing right bracket (]) delimit the body of a class
Variables inside the class definition but not a method definition are called instance variables.
On Member Access Modifiers - public means member is accessible wherever an instance of the object exists and
private means members is accessible only inside the class definition.
Constructor can return a value.
Only one constructor can be declared on a class.
A class can contain one or more destructor.
All members are accessible within the class's methods and can be referenced by name.
Data members should be declared private, with public properties that allow safe access to them.
Objects are also known as instances of a class.
Destructors can have arguments or parameters.
Declared variables in a method are local variables.
Page 1
12.
13.
14.
15.
16.
17.
18.
19.
20.
A _____ can be considered a lightweight class,ideal for creating data types that store small amounts of data, and
does not represent a type that might later be extended via inheritance.
struct
class
object
None of the given choices
2.
C#
A.
B.
C.
D.
3.
__________is a group of classes and their methods. It can be included in a program with the using keyword
A. Namespace
B. Library
C. Objects
D. None of the given choices
4.
_________ are programming constructs that have data, behavior, and identity.
A. Namespace
B. Library
C. Objects
D. None of the given choices
5.
Objects are _______; that is, they are created from templates defined by classes and structs.
A. instantiated
B. inherited
C. declared
D. None of the given choices
6.
Objects use ______to obtain and change the information they contain.
A. get accessor
B. set accessor
C. object browser
D. None of the given choices
7.
The ________allows you to change the attributes of objects such as Windows Forms.
A. properties window
B. Solution explorer
C. object browser
D. None of the given choices
8.
9.
10.
classes support ______, meaning they can derive from a previously defined class.
polymorphism
inheritance
data abstraction
None of the given choices
Page 2
Fields, properties, methods, and events on a class are collectively referred to as ______.
A. attributes
B. class members
C. characteristics
D. None of the given choices
12.
An
A.
B.
C.
D.
13.
Objects can be created using the _____ keyword followed by the name of the class.
A. class
B. new
C. this
D. None of the given choices
14.
A base class is specified by appending a _____ and the name of the base class following the derived class name.
A. semicolon
B. colon
C. dot
D. None of the given choices
15.
16.
17.
_______ helps avoid memory leaks which means running out of memory because unused memory has not been
reclaimed.
A. Clear
B. Collect
C. Dispose
D. None of the given choices
18.
Classes are created by absorbing the methods and variables of an existing class
A. Inheritance
B. Polymorphism
C. Modularity
D. None of the given choices
19.
If a
A.
B.
C.
D.
20.
base class method is going to be overridden it must be declared using the keyword ____
virtual
const
readonly
None of the given choices
Represents an open connection to a SQL Server database. This class cannot be inherited.
Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class
cannot be inherited.
Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL
Server database. This class cannot be inherited.
Page 3
4.
5.
Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be
inherited.
It is a control that allows you to display a list of items with item text and, optionally, an icon to identify the type of
item. This control can be used to display information from an application, a database, or a text file. It provides a
large number of properties that provide flexibility in appearance and behavior.
Prepared by:
Evaluated by:
Approved by:
EUGENE Q. CASTRO
Instructor
DATE: ________________
DATE: __________________
DATE: _________________
Page 4
ANSWER SHEET
FINAL EXAMINATION
OOP310: Object-Oriented Programming
NAME: ___________________________________
DATE: _______________________
INSTRUCTOR: _________________
PART I.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
PART III.
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
PART II.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
PART IV.
1.
2.
3.
4.
5.
_____________________
_____________________
_____________________
_____________________
_____________________
SCORE SUMMARY:
PART
SCORE
TOTAL
50
II
20
III
20
IV
15
15
TOTAL
120
Page 5
Page 6
ANSWER SHEET
FINAL EXAMINATION
OOP310: Object-Oriented Programming
NAME: ___________________________________
DATE: _______________________
INSTRUCTOR: _________________
PART V.
Page 7