Liz
2013-01-09 19:40:19 UTC
A) finalcatch
B) finally
C) endcatch
D) stop
When a data field is private, it is said to be ____ to any class other than the one in which it is defined.
A) uninheritable
B) implicit
C) unreachable
D) inaccessible
____ variables and constants are those that are known to an entire class.
A) Global
B) Local
C) Universal
D) Comprehensive
A ____ reference is an automatically created variable that holds the address of an object and passes it to an instance method whenever the method is called.
A) key
B) public
C) that
D) this
When appropriate, specialized ____ classes provide an elegant way for you to handle error situations.
A) Exception
B) Error
C) Constructor
D) Event
What is the screen output of the following code segment? Explain the reasoning behind your answer.
Test1 = 70
Test2 = 80
Test3 = 84
NumberOfTests = 3
Average = (Test1 + Test2 + Test3) / NumberOfTests
IF Average >= 90 THEN
Output “Great job”
Output “Your average is: ”, Average
ELSE
IF Average >= 80 or Average <=89 THEN
Output “Nice work”
Output “Your average is: “, Average
ELSE
Output : “Your Average is:”, Average
Output “, You will do better next time!”
ENDIF
Class diagrams are a type of ____ diagram.
A) Unified Illustration Language
B) Unified Modeling Language
C) Object-Oriented Modeling Language
D) Unified Pseudocode Language
When a main() method needs to use another method, it calls, or invokes it.
A) True
B) False
What will be the output of the below program? List what will be outputed to the screen and explain your answer.
class Class_name
main()
// Declarations
num index
num SIZE = 10
num numbers[SIZE] = 0,0,0,0,0,0,0,0,0,0
index = 0
while index < SIZE
numbers[index]= index * 10
index = index + 1
endwhile
output “The Output is: ”
while index > 0
index = index – 1
output numbers[index]
endwhile
return
endClass
Programmers refer to hidden implementation details as existing in a ____.
A) white box
B) white hole
C) black box
D) black hole
The ability to use methods without knowing the details of their contents is a feature of ____.
A) abstraction
B) encapsulation
C) inheritance
D) construction
A(n) ____ is one instance of a class.
A) method
B) object
C) instantiation
D) attribute
A ____ is one that sends an exception object out of a method so it can be handled elsewhere.
A) catch statement
B) throw method
C) catch block
D) throw statement
____ is the process of creating a new, derived class from a base class.
A) Accessibility
B) Encapsulation
C) Inheritance
D) Polymorphism
A method is a program module that contains a series of statements that carry out a task.
A) True
B) False
Design a class named CustomerRecord that holds a customer number, name, and address. Include methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code (not language specific, ie. psuedocode) that defines the class.
A child class contains all the data fields and ____ of its parent
Write a method that will perform the a division operation (divide by) on the numbers passed to it in two variables (numerator, denominator) and outputs the results. Use a try-catch pair to output an error message if the illegal operation of divide by 0 occurs.
An object is a category of things.
A) True
B) False