TCC101: Programming Quiz 1 https://lms.wou.edu.my/mod/quiz/attempt.php?
id=901
You are logged in as JF Chow ( Logout)
WOU School of Science and Technology TCC101 Quizzes Programming Quiz 1 Attempt 1
Programming Quiz 1 - Attempt 1
1 Assembly languages are first generation languages.
Marks: --/1
Answer: True
False
Submit
2 In Java, both ! and != are relational operators
Marks: --/1
Answer: True
False
Submit
3 Arrays are made up only of integers.
Marks: --/1
Answer: True
False
Submit
4 An object is created by a Java program using the new operator.
Marks: --/1
Answer: True
False
Submit
1 of 5 27/04/2007 14:10
TCC101: Programming Quiz 1 https://lms.wou.edu.my/mod/quiz/attempt.php?id=901
5 The output of the Java code:
Marks: --/1
int num = 20;
if (num <= 10) //Line 1
if (num >= 0) //Line 2
System.out.println("Num is between 0 and 10"); //Line 3
else //Line 4
System.out.println("Num is greater than 10"); //Line 5
is: Num is greater than 10.
Answer: True
False
Submit
6 A linker translates the assembly language instructions into machine
Marks: --/1
language.
Answer: True
False
Submit
7 When an if-else is contained inside of a method, the if-else
Marks: --/1
statement is called a nested if.
Answer: True
False
Submit
8 In Java, && has a higher precedence than ||.
Marks: --/1
Answer: True
False
Submit
9 In Java. the expression
Marks: --/1
'A' < ch < 'Z'
is equivalent to the expression
'A' < ch && ch < 'Z'
Answer: True
False
Submit
2 of 5 27/04/2007 14:10
TCC101: Programming Quiz 1 https://lms.wou.edu.my/mod/quiz/attempt.php?id=901
10 The output of the Java code
Marks: --/1
int count = 5;
System.out.print("St");
do
{
System.out.print('o');
count--;
}
while (count < 5);
System.out.println('p');
is: Stop
Answer: True
False
Submit
11 The program that interprets the byte codes on your hardware is called the
Marks: --/1
Java Virtual Machine
Answer: True
False
Submit
12 Suppose x = 10 and y = 20. The value of the expression ((x >= 10) &&(y <= 20)) is true.
Marks: --/1
Answer: True
False
Submit
13 The output of the Java code (Assume all variables are properly declared.)
Marks: --/1
for (i = 1; i <= 10; i++);
System.out.print(i + " ");
System.out.println();
is: 1 2 3 4 5 6 7 8 9 10
Answer: True
False
Submit
3 of 5 27/04/2007 14:10
TCC101: Programming Quiz 1 https://lms.wou.edu.my/mod/quiz/attempt.php?id=901
14 Consider the following the statements.
Marks: --/1
String str1 = "cat";
String str2 = "cats";
Determine whether the statement
str1.equals(str2);
is true or false.
Answer: True
False
Submit
15 onsider the following while loop.
Marks: --/1
int counter = 1;
while (counter < 10)
{
//...
counter++;
if (counter % 4 == 0)
continue;
counter = 0;
//...
}
If the continue statement executes, counter is set to 0.
Answer: True
False
Submit
16 The following for loop executes 20 times. (Assume all variables are properly declared.)
Marks: --/1
for (i = 0; i <= 20; i++)
System.out.println(i);
Answer: True
False
Submit
17 The statement immediately following the while is called the loop body. It
Marks: --/1
can be a block statement by including several statements between braces {
and }.
Answer: True
False
Submit
4 of 5 27/04/2007 14:10
TCC101: Programming Quiz 1 https://lms.wou.edu.my/mod/quiz/attempt.php?id=901
18 Given the declaration
Marks: --/1
int[] list = new int[20];
the statement
list[12] = list[5] + list[7];
updates the content of the twelfth component of the array list.
Answer: True
False
Submit
19 The output of the Java code
Marks: --/1
int x = 5;
if (x > 10)
System.out.println("Hello ");
else
System.out.println("There. ");
System.out.println("How are you?");
is: There. How are you?
Answer: True
False
Submit
20 A loop is a control structure that causes certain statements to be executed over and over until certain
Marks: --/1
conditions are met.
Answer: True
False
Submit
Save without submitting Submit page Submit all and finish
You are logged in as JF Chow ( Logout)
5 of 5 27/04/2007 14:10