] > final exam

exit final exam

NAME¯

 
CSE 214: Final Term Exam
 
Tu, Dec 9, 3:30—5:18
Open Notes, Open Books
The exam consists of eight¯ problems
Answers not appearing in designated spaces WILL NOT be graded

Problem #1 (10 points)
Show the output of the following program.
Problem #2 (10 points)
Show the output of the following program.
Problem #3 (10 points)
Show the output of the following program.
Problem #4 (10 points)
Show the output of the following program.
Problem #5 (10 points)
Show the output of the following program.
Problem #6 (10 points)
Write a program that prints 20 different randomly generated integer values smaller than 1000. The program is not allowed to use arrays.

Note. The random number generator may be invoked more than 20 times. For instance, an output ‘1 2 4 3 5 7 6 8 9 10 11 12 13 14 15 16 17 18 19 20’ may result from the numbers ‘1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 2 3 4 5 6 7 8 9 20’.

Problem #7 (10 points)
Provide the missing code so that the given program will compile with no error.
Problem #8 (10 points)
The given incomplete program should produce the following output.
10  
a  
0  
1a

Provide the missing code of the program.

Note. The java.lang.Integer class offers the following pair of possibly useful methods.