Search Header Logo

Diagnostic Test G12

12th Grade

Used 4+ times

Diagnostic Test G12
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?