0% found this document useful (0 votes)
31 views4 pages

Self-Quiz Unit 1_ Attempt review _ Home

Uopeople Exams Question Programming 1 , computer Science program

Uploaded by

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

Self-Quiz Unit 1_ Attempt review _ Home

Uopeople Exams Question Programming 1 , computer Science program

Uploaded by

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

07/09/2024 20:56 Self-Quiz Unit 1: Attempt review | Home

Started on Saturday, 7 September 2024, 7:52 PM


State Finished
Completed on Saturday, 7 September 2024, 7:56 PM
Time taken 3 mins 29 secs
Marks 6.00/6.00
Grade 10.00 out of 10.00 (100%)

Question 1
Correct
Mark 1.00 out of 1.00

What is the value of "result" after executing the following code snippet?
int result = 10;
result -= 2 * 3;

a. 4 
b. 6
c. 8
d. 10

Your answer is correct.

https://my.uopeople.edu/mod/quiz/review.php?attempt=15373529&cmid=433498 1/4
07/09/2024 20:56 Self-Quiz Unit 1: Attempt review | Home

Question 2
Correct
Mark 1.00 out of 1.00

Which of the following is the correct way to declare and initialize an array in Java?
a. int[ ] numbers = new int[5] {1, 2, 3, 4, 5};
b. int[ ] numbers = {1, 2, 3, 4, 5};
c. int numbers[ ] = new int[ ]{1, 2, 3, 4, 5};
d. int numbers = [1, 2, 3, 4, 5];

a. Option a and Option b


b. Option b and Option c 
c. Option c
d. Option b

Your answer is correct.

Question 3
Correct
Mark 1.00 out of 1.00

Which of the following is the correct way to declare a constant variable in Java?

a. final int PI = 3.14; 


b. const int PI = 3.14;
c. int PI = 3.14;
d. static int PI = 3.14;

Your answer is correct.

https://my.uopeople.edu/mod/quiz/review.php?attempt=15373529&cmid=433498 2/4
07/09/2024 20:56 Self-Quiz Unit 1: Attempt review | Home

Question 4
Correct
Mark 1.00 out of 1.00

Which of the following data types in Java is NOT used to store integer values?

a. int
b. long
c. byte
d. float 

Question 5
Correct
Mark 1.00 out of 1.00

What is the result of the following code snippet?


int x = 10;
int y = 5;
boolean result = (x > y) && (x != y);
System.out.println(result);

a. True 
b. False
c. 10
d. 5

Your answer is correct.

https://my.uopeople.edu/mod/quiz/review.php?attempt=15373529&cmid=433498 3/4
07/09/2024 20:56 Self-Quiz Unit 1: Attempt review | Home

Question 6
Correct
Mark 1.00 out of 1.00

What will be the value of x after the following code snippet?


int x = 5;
x *= 2 + 3;

a. 10
b. 15
c. 25 
d. 30

Your answer is correct.

https://my.uopeople.edu/mod/quiz/review.php?attempt=15373529&cmid=433498 4/4

You might also like