QUESTION 1 What will be the output of the below program? List what will be outpu
ID: 3568473 • Letter: Q
Question
QUESTION 1
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
QUESTION 2
A parent class is the same thing as a base class.
True
False
QUESTION 3
Overloaded methods have the same name and parameter lists.
True
False
QUESTION 4
Global variables are known to the entire class.
True
False
QUESTION 5
Multiple inheritance is the capability to inherit more than one method from a parent class.
True
False
QUESTION 6
Everything is an object, and every object is a member of a ____.
A. class B. method C. case D. process
QUESTION 7
A ____ is a segment of code that can handle an exception that might be thrown by the try block that precedes it. A. catch method B. throw block C. catch block D. throw statement
QUESTION 8
When a main() method needs to use another method, it calls, or invokes it.
True
False
QUESTION 9
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
QUESTION 10
A(n) ____ statement indicates the end of the catch block in the pseudocode.
A. finalcatch B. finally C. endcatch D. stop
QUESTION 11
A method is a program module that contains a series of statements that carry out a task.
True
False
QUESTION 12
Libraries are collections of classes that serve related purposes.
True
False
QUESTION 13
What is one item that must be included in a method's header if it can receive a parameter?
A. local parameter name B. global parameter name C. parameter's client D. return data structure
QUESTION 14
When appropriate, specialized ____ classes provide an elegant way for you to handle error situations.
A. Exception B. Error C. Constructor D. Event
QUESTION 15
The call stack is where the computer stores the list of exceptions.
True
False
QUESTION 16
An instance method or constructor may be overloaded by providing the same name and ____ argument list. A. a different B. the same C. a larger D. a smaller
QUESTION 17
A constructor may require ____.
A. parameters B. methods C. objects D. inheritance
QUESTION 18
The memory location known as the ____ is where the computer stores the list of method locations to which the system must return.
A. method stack B. location stack C. call stack D. store location
QUESTION 19
____ variables and constants are those that are known to an entire class.
A. Global B. Local C. Universal D. Comprehensive
Explanation / Answer
Solutions are given in bold
QUESTION 1
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
output
0,0,0,0,0,0,0,0,0,0
Since we get array contains all zeros if we multiply 10 nothing changes
QUESTION 2
A parent class is the same thing as a base class.
True
False
QUESTION 3
Overloaded methods have the same name and parameter lists.
True
False
QUESTION 4
Global variables are known to the entire class.
True
False
QUESTION 5
Multiple inheritance is the capability to inherit more than one method from a parent class.
True
False
QUESTION 6
Everything is an object, and every object is a member of a ____.
A. class B. method C. case D. process
QUESTION 7
A ____ is a segment of code that can handle an exception that might be thrown by the try block that precedes it. A. catch method B. throw block C. catch block D. throw statement
QUESTION 8
When a main() method needs to use another method, it calls, or invokes it.
True
False (since if is not static method we need to create object)
QUESTION 9
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
QUESTION 10
A(n) ____ statement indicates the end of the catch block in the pseudocode.
A. finalcatch B. finally C. endcatch D. stop
QUESTION 11
A method is a program module that contains a series of statements that carry out a task.
True
False
QUESTION 12
Libraries are collections of classes that serve related purposes.
True
False
QUESTION 13
What is one item that must be included in a method's header if it can receive a parameter?
A. local parameter name B. global parameter name C. parameter's client D. return data structure
QUESTION 14
When appropriate, specialized ____ classes provide an elegant way for you to handle error situations.
A. Exception B. Error C. Constructor D. Event
QUESTION 15
The call stack is where the computer stores the list of exceptions.
True
False
QUESTION 16
An instance method or constructor may be overloaded by providing the same name and ____ argument list. A. a different B. the same C. a larger D. a smaller
QUESTION 17
A constructor may require ____.
A. parameters B. methods C. objects D. inheritance
QUESTION 18
The memory location known as the ____ is where the computer stores the list of method locations to which the system must return.
A. method stack B. location stack C. call stack D. store location
QUESTION 19
____ variables and constants are those that are known to an entire class.
A. Global B. Local C. Universal D. Comprehensive
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.