
Diagnostic Test G12

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
Similar Resources on Wayground
25 questions
Review Python

Quiz
•
12th Grade
25 questions
Algorithms - python (GCSE)

Quiz
•
10th - 12th Grade
25 questions
Java Review

Quiz
•
9th Grade - University
25 questions
python 3-5 unit 10gr

Quiz
•
10th Grade - University
26 questions
Новогодняя по Pythony

Quiz
•
9th - 12th Grade
30 questions
Java Code Output Quiz

Quiz
•
9th - 12th Grade
25 questions
C Programming

Quiz
•
12th Grade - University
25 questions
1st Period Feb 22, 2024 - Virtual AP CompSci AP

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade