Unit 3 If statements Quiz
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Karen Russo
Used 10+ times
FREE Resource
Enhance your content
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Pick the value that best completes the sentence: A boolean variable has _______ value(s).
only one valid
two valid
three valid
only invalid
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What mathematical symbol/word does the symbol && in java represent?
and
or
average
absolute value
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the symbol ! mean in a boolean expression?
Always use 0 for x
Always true
Never true
Not
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If x = 5, y = 10 and z = 10, the expression
(x < y) && !(y ==z)
will return the value of _______________.
true
false
null
cannot be determined
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output for the following program segment?
int num = 20;
if (num > 0)
if (num % 5 == 0)
System.out.println(num);
else System.out.println(num + " is negative ");
20
4
4 is negative
20 is negative
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What line of code would replace the following algebraic inequality?
-3 < x || x < 5
-3 <= x || x < 5
-3 < x && x < 5
-3 < = x && x < 5
7.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Consider the following code assuming the variables have been properly defined.
String mystery_word = new String ("Comp Sci ");
System.out.println ("Enter a word ");
String word = reader.nextLine();
// compare the word to the mystery word
if (*** line of code goes here ****)
System.out.println ( "your word matches");
else
System.out.println ("The words do not match");
What is the proper code to compare the two words?
! (word.equals(mystery_word))
! ( word == mystery_word)
(word.equals(mystery_word))
(word == mystery_word)
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
RPMS - IPCRF by Jenelou John Israel
Quiz
•
12th Grade
15 questions
Начала программирования на языке Паскаль
Quiz
•
8th - 11th Grade
15 questions
Chapter 3: Storage devices and media (Part 2):
Quiz
•
10th - 11th Grade
10 questions
Fundamentals of Algorithms
Quiz
•
10th Grade
11 questions
Процедуры и функции
Quiz
•
10th Grade
13 questions
Nhập môn HTML
Quiz
•
6th - 9th Grade
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
10 questions
Aplikasi Pengolah Slide (Powerpoint)
Quiz
•
10th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
Discover more resources for Computers
18 questions
Artificial Intelligence and Machine Learning Quiz
Quiz
•
9th Grade
35 questions
Computer Terminology Exercise #1 ( Multiple Choice)
Quiz
•
9th Grade
20 questions
Computer Components Exercise #4 - CTEA
Quiz
•
9th - 12th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
