[go: up one dir, main page]

0% found this document useful (0 votes)
140 views7 pages

1st Summative-Test-Java-11-for 2nd Quarter

The document provides a table of specification and summative test for the Java Programming NCII course. It outlines 5 learning outcomes to be assessed over 20 days through 25 multiple choice items. It then provides a 25 question multiple choice test on Java concepts like conditional statements, loops, operators, and decision constructs. The test also contains questions to analyze and identify the output of code snippets using if-else statements and for loops.

Uploaded by

Mike John Maximo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views7 pages

1st Summative-Test-Java-11-for 2nd Quarter

The document provides a table of specification and summative test for the Java Programming NCII course. It outlines 5 learning outcomes to be assessed over 20 days through 25 multiple choice items. It then provides a 25 question multiple choice test on Java concepts like conditional statements, loops, operators, and decision constructs. The test also contains questions to analyze and identify the output of code snippets using if-else statements and for loops.

Uploaded by

Mike John Maximo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

 (0926) 934-3805306112bnhs@gmail.

com

Table of Specification
JAVA PROGRAMMING NCII
SUMMATIVE TEST

MELCS No. of No. of


Days/Hour Items
s
LO 1. Apply basics of Java language
1.5 Demonstrate using Operators and Decision
5 6
Constructs in accordance with Java framework
(TLE_ICTJAVA11-12POAD-IIf-i-29)
LO 1. Apply basics of Java language
1.7 Demonstrate using Loop Constructs in accordance
5 6
with Java framework
(TLE_ICTJAVA11-12POAD-IIf-i-29)
LO 1. Apply basics of Java language
1.5 Demonstrate using switch statement 5 6
(TLE_ICTJAVA11-12POAD-IIj-IIIa-c-30)
LO 1. Apply basics of Java language
1.6 Demonstrate while and for loop
5 7
(TLE_ICTJAVA11-12POAD-IIf-i-29)

Total 20 25
JAVA Programming

Name:______________________________________ Grade and Section:_____________________

Direction: Read carefully the given questions and choose the correct answer. Write your
answer on the answer sheet provided.

1. This conditional statement is used to specify a block of code to be executed, if a specified


condition is true
a. if c. else if
b. else d. switch
2.Use to specify a block of code to be executed, if the same condition is false
a. if c. else if
b. else d. switch
3. Use to specify a new condition to test, if the first condition is false
a. if c. else if
b. else d. switch
4. To specify many alternative blocks of code to be executed
a. if c. else if
b. else d. switch
5. Java supports the usual logical conditions from mathematics
a. True c. Partly True
b. False d. Partly False
6. This will stop the execution of more code and case testing inside the block. When a match
is found, and the job is done, it's time for a break. There is no need for more testing.
a. Break c. Default
b. Case d. Switch
7. This keyword specifies some code to run if there is no case match:
a. Break c. Default
b. Case d. Switch
8. Default statement is used as the last statement in a switch block, it does not need a break.
a. True c. Partly True
b. False d. Partly False
9. This loop loops through a block of code as long as a specified condition is true:
a. for loop c. loops
b. while loop d. for each loop
10. You can use this loop when you know exactly how many times you want to loop through
a block of code.
a. for loop c. loops
b. while loop d. looping
11. How many choices are possible when using a single if-else statement?
a. 1 c. 3
b. 2 d. 4

For items 12-20, analyze then identify the output of the following code

12.
int sum = 14;
if ( sum < 20 )
System.out.print("Under ");
else
System.out.print("Over ");
System.out.println("the limit.");
a. Under c. Under the limit
b. Over d. Over the limit

13.
int sum = 14;
if ( sum < 20 )
System.out.print("Under ");
else
{
System.out.print("Over ");
System.out.println("the limit.");
}

(Notice that the program has changed from the previous question!)
a. Under c. Under the limit
b. Over d. Over the limit

14. int sum = 94;


if ( sum < 20 )
{
System.out.print("Under ");
System.out.println("the limit.");
}
else
{
System.out.print("Over ");
System.out.println("the limit.");
}

(Notice that the program has changed from the previous question!)

a. Under c. Under the limit


b. Over d. Over the limit

15. int sum = 7;


if ( sum > 20 )
{
System.out.print("You win ");
}
else
{
System.out.print("You lose ");
}
System.out.println("the prize.");
(Notice that the program has changed from the previous question!)
a. You win c. You win the prize
b. You lose d. You lose the prize

16.
int sum = 21;
if ( sum == 20 )
{
System.out.print("You win ");
}
else
{
System.out.print("You lose ");
}
System.out.println("the prize.");

(Notice that the program has changed from the previous question!)
a. You win c. You win the prize
b. You lose d. You lose the prize

17.
int sum = 21;
if ( sum != 20 )
System.out.print("You win ");

else
System.out.print("You lose ");

System.out.println("the prize.");

(Notice that the program has changed from the previous question!)
a. You win c. You win the prize
b. You lose d. You lose the prize

18 for ( int j = 0; j < 5; j++ )


{
System.out.print( j + " " );
}
System.out.println( );
a. 0 1 2 3 4 5 c. 1 2 3 4 5
b. 0 1 2 3 4 d. 1 2 3 4

19. for ( int j = 10; j > 5; j-- )


{
System.out.print( j + " " );
}
System.out.println( );

a. 10 11 12 13 14 15 c. 10 9 8 7 6 5
b. 9 8 7 6 5 4 3 2 1 d. 10 9 8 7 6

20. for ( int j = 5; j > -5; j-- )


System.out.print( j + " " );

System.out.println( );

a. -5 -4 -3 -2 -1 0 c. 5 4 3 2 1 0 -1 -2 -3 -4 -5
b. 5 4 3 2 1 0 d. 5 4 3 2 1 0 -1 -2 -3 -4

21. What must the test be so that the following fragment prints out the integers 5 through and
including 15?
for ( int j = 5; ________ ; j++ )
{
System.out.print( j + " " );
}
System.out.println( )
a. int j <15 c. int j <16
b. int j < =15 d. int j ==15

22. What must the change be so that the following fragment prints out the even integers 0 2 4
6 8 10?
for ( int j = 5; ________ ; j++ )
{
System.out.print( j + " " );
}
System.out.println( )
a. j+2 c. j-2
b. j=j+2 d. j=-2

23. A sequence of statements contained within a pair of braces ("{" and "}") is called a:
a. Block c. Branch
b. Blop d. Brick
24. Evaluate (to true or false) each of the following expressions:
14 <= 14 , 14 < 14 , -9 > -25 , -25 > -9
a. true true true true c. true false true true
b. true false false false d. true false true false

25. Say that value has a 19 stored in it, and that extra has a 25 stored in it. Evaluate (to true or
false) each of the following expressions:
value <= extra , extra < value , value > -25 , value >= extra

a. true false true false


b. true true true false
c. false false true false
d. false false true true
ANSWER KEY IN JAVA

1. A
2. B
3. C
4. D
5. A
6. C
7. B
8. A
9. B
10. A
11. B
12. C
13. A
14. D
15. D
16. D
17. C
18. B
19. D
20. D
21. C
22. B
23. A
24. D
25. A

You might also like