Diagnostic Test G12

Diagnostic Test G12

12th Grade

30 Qs

quiz-placeholder

Similar activities

Java Code Output Quiz

Java Code Output Quiz

9th - 12th Grade

30 Qs

Code HS JavaScript Control Structures

Code HS JavaScript Control Structures

9th - 12th Grade

25 Qs

SAINS KOMPUTER TINGKATAN 4 - 1.6 STRUKTUR DATA DAN MODULAR

SAINS KOMPUTER TINGKATAN 4 - 1.6 STRUKTUR DATA DAN MODULAR

7th - 12th Grade

25 Qs

AP Java Exam

AP Java Exam

10th - 12th Grade

25 Qs

Chapter 2 Review

Chapter 2 Review

10th - 12th Grade

25 Qs

APCSA Unit 7

APCSA Unit 7

9th - 12th Grade

25 Qs

CodeHS Arraylist

CodeHS Arraylist

9th - 12th Grade

25 Qs

Array List

Array List

9th - 12th Grade

25 Qs

Diagnostic Test G12

Diagnostic Test G12

Assessment

Quiz

12th Grade

Medium

Used 4+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. Which of the following variable declarations will result in an error?

A. int a =10.0;

B. double y = 100;

C. int x = 100;

D. double a, b=20.0;

E. String name= “AHMED”;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What is the output of the code segment given below?


int X=10;

int Y=20;

int Z=10;

int result = X + (Y + Z ) / 3;

System.out.print (" The average is: " + result);

A.The average is: 33

B.The average is: 13

C.The average is: 20

D.The average is: + result

E. The average is: + 40

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. Which of the following is an assignment operator?

==

!=

=

>

>=

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. What is the result of the following expression knowing that int X = 1 and double Y = 2.0?


100 / ((X + 4) * Y)

0

4

10

10.0

25

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. Which of the below Java keywords is used to define a constant?

A. static

B.class

C.final

D.main

E.public

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Given a=10, b=5, c=0. Which of the following expressions will evaluate to false?

A.(a>=10 && b!=c )

B. ((a<b) || (a<c))

C. (!(a<c) || (b > 10))

D. ((a==b) || (c <b))

E. ((a>b) && (a>c))

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Refer to the code below to answer question 6.


public static void main(String args[ ])

{

int count = 1;

while ( ………………………. ) //Line 4

{

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

count = count + 5;

} }


Which of the below condition(s) can be used in the space provided in Line 4, to get the following output?


1 6 11 16


I. count <= 20

II. count <= 19

III. count <20

A. I only

B. II only

C. III only

D. I and II only

E. I, II and III

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?