Académique Documents
Professionnel Documents
Culture Documents
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is a source from which you can seek help when you're
debugging?
Select one:
a. Forums
b. Yourself
c. Yourself, search engines, forums, and co-workers
d. Search engines
Feedback
The correct answer is: Yourself, search engines, forums, and co-workers
Question
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is not valid for headers?
Select one:
a. for ( int i = 0; i < 10; i++ )
Feedback
The correct answer is: for ( int i = 0; int j = 5; ; i++ )
Question
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is a correct syntax of comment used in programming language?
Select one:
a. */ Comment */
b. /{ Comment }
c. ** Comment **
d. /* Comments */
Feedback
The correct answer is: /* Comments */
Question
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Adding a derived class to a base class requires fundamental changes to the base class
Select one:
True
False
Feedback
The correct answer is 'False'.
Question
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Unless specified, entire arrays are passed __________ and individual array elements are
passed __________.
Select one:
a. By reference, by reference
b. By value, by reference.
c. By reference, by value.
d. By value, by value.
Feedback
Correct
Mark 1.00 out of 1.00
Flag question
Question text
You can write a Java program that runs on Windows and it will work just the same on
Unix and Linux.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Polymorphism: - It is the means by which an operation behaves differently in different
contexts.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Which type of error is caused when code is executed but there are undesired results?
Select one:
a. Logic error
b. Runtime error
c. Syntax error
d. Browser error
Feedback
The correct answer is: Logic error
Question
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Polymorphism reduces the effort required to extend an object system by
Select one:
a. Making objects more dependent on one another
b. enabling a number of different operations to share the same name
c. Coupling objects together more tightly
d. Removing the barriers imposed by encapsulation.
Feedback
The correct answer is: enabling a number of different operations to share the same
name
Question
10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
In a Javascript program, the word preceding the " . " represents
Select one:
a. A program name
b. A command
c. An action by an object
d. An object
Feedback
The correct answer is: An object
Question
11
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
A client changing the values of private data members is:
Select one:
a. Only possible by calling private member functions.
b. Possible using public/protected functions and references.
c. Only possible if the private variables are not declared inside the class
d. Never possible.
Feedback
The correct answer is: Possible using public/protected functions and references.
Question
12
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
If you design a class that needs special initialization tasks, you will want to design
Select one:
a. housekeeping routine
b. initializer
c. constructor
d. compiler
Feedback
The correct answer is: constructor
Question
13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A variable will last until
Select one:
a. Hard disc is formatted
b. Computer is switched off
c. The value of the variable is used in the program
d. The program completes and exit
Feedback
The correct answer is: The program completes and exit
Question
14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The do...while loop is ideal for loop structures that
Select one:
a. Must execute some process at least one time.
b. Do all of the items.
c. Repeat some process a fixed number of times.
d. Must check the loop condition before the loop body is executed.
Feedback
The correct answer is: Must execute some process at least one time.
Question
15
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is NOT a software language?
Select one:
a. Visual Basic
b. HTML
c. C++
d. C
Feedback
The correct answer is: HTML
Question
16
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following statements is false?
Select one:
a. Functions allow programmers to break large and complex problems into small and
manageable tasks
b. A function is a block of code that performs a specific task
c. Functions can be called, or invoked, only once in a program
d. Functions allow programmers to use existing code to perform common tasks
Feedback
The correct answer is: Functions can be called, or invoked, only once in a program
Question
17
Complete
Not graded
Flag question
Question text
What is wrong with the following while loop?
Select one:
a. There should be a semicolon after while ( sum <= 1000 )
b. while ( sum <= 1000 )
c. The parentheses should be replaced with braces
Feedback
The correct answer is: sum = sum - 30 should be sum = sum + 30 or else the loop may
never end
Question
18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What is the difference between a try-catch block and a try-catch-finally block?
Select one:
a. try-catch contains code to execute whether an occurs or not, try-catch-finally
contains code to execute only if an error occurs
b. try-catch contains code to execute only if an error occurs, try-catch-finally contains
code to execute whether an occurs or not
c. Same thing, different names
d. try-catch contains code to execute if an error occurs or not, while try-catch-finally
works the same way as try-catch block with the addition of a set of code that will
execute whether an error occurs or not.
Feedback
The correct answer is: try-catch contains code to execute if an error occurs or not, while
try-catch-finally works the same way as try-catch block with the addition of a set of code
that will execute whether an error occurs or not.
Question
19
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Every time we supply a new set of values to the program at the command prompt, we
need to recompile the program.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question
20
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Encapsulation: This helps in controlling the visibility of internal details of the objects. It
improves security and integrity of data
Select one:
True
False
Feedback
The correct answer is 'True'.
Question
21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Java and javascript are the same thing.
Select one:
True
False
Feedback
The correct answer is 'False'.
Question
22
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
A nibble corresponds to
Select one:
a. 8 bits
b. 32 bits
c. 4 bits
d. 16 bits
Feedback
The correct answer is: 4 bits
Question
23
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The OR (||) operator:
Select one:
a. Has higher precedence than the AND (&&) operator
b. Associates from right to left.
c. Is a ternary operator
d. Stops evaluation upon finding one condition to be true.
Feedback
The correct answer is: Stops evaluation upon finding one condition to be true.
Question
24
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is something you can do that will make debugging easier?
Select one:
a. Indenting your code
b. Breaking down into smaller parts
c. Using a lot of comments
d. Indenting your code, using a lot of comments, breaking down into smaller parts, and
maintaining neatness and readability
Feedback
The correct answer is: Indenting your code, using a lot of comments, breaking down into
smaller parts, and maintaining neatness and readability
Question
25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
A constructor can specify the return type void.
Select one:
a. int
b. A constructor cannot specify a return type
c. string.
Feedback
The correct answer is: A constructor cannot specify a return type
Question
Correct
26
Question text
You have a situation where you want to stop the execution of code at a certain point to
see how things function, what would you do?
Select one:
a. Get the line number where there is an error and remove it from the code
b. Execute code from the address bar
c. Try viewing the page in a different browser
d. Set a breakpoint
Feedback
The correct answer is: Set a breakpoint
Question
27
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
(A/An) ____________ is a contract in the form of a collection of method and constant
declarations. When a class implements (a/an) ____________, it promises to implement all
of the methods declared in that ____________. Select the best word to complete this
sentence.
Select one:
a. Abstract Class
b. Interface
c. Class
d. Function
Feedback
The correct answer is: Interface
Question
28
Correct
Mark 1.00 out of 1.00
Flag question
Question text
If an attribute is private, which methods have access to it?
Select one:
a. Only classes in the same package.
b. Only those defined in the same class.
c. Only static methods in the same class.
d. Only instance methods in the same class.
Feedback
The correct answer is: Only those defined in the same class.
Question
29
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
What is object-oriented programming?
Select one:
a. A type of programming not in use anymore
b. A type of programming using only numbers
c. A type of programming involving data types representing data structures
d. A type of programming involving a structured method of creating programs
Feedback
The correct answer is: A type of programming involving data types representing data
structures
Question
30
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
When the compiler cannot differentiate between two overloaded constructors, they are
called
Select one:
a. ambiguous
b. destructed
c. dubious
d. overloaded
Feedback
The correct answer is: ambiguous
Question
31
Correct
Mark 1.00 out of 1.00
Flag question
Question text
____ Contains an extra field in each record that holds a pointer to the next logical record.
Select one:
a. PHYSICAL MEMORY
b. LINKED LIST
c. INDEX
d. RANDOM-ACCESS MEMORY
Feedback
The correct answer is: LINKED LIST