Which line of code would set x = to a number between 50 and 100?

AP computer science unit 2

Quiz
•
9th - 12th Grade
•
Medium
Sherry Dieterich
Used 786+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
int x = (int) (Math.random()*50)+50;
int x = (int) (Math.random()*50)-50;
int x = (int) (Math.random()*50)+51;
int x = (int) (Math.random()*50)+49;
2.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
What is printed when the code is run?
Frankvelt
ranklivelt
Franko
lino
3.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
What will print when this code is run?
7
9.0
5.66
5.0
4.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
What will s equal? int s = Math.abs(13-21);
8
-8
8.0
-8.0
5.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Which would be a valid call to this code?
PT(21.0, 8);
PT(7,"4");
PT(2,4);
PT(1.0,1.0);
6.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
What will l = after the code is run?
5
6
7
8
7.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
What will p = after the code is run? String p = "cat " + 9;
cat
Nothing will print
The code will not compile
cat 9
Create a free account and access millions of resources
Similar Resources on Quizizz
13 questions
Exploring Computer Science

Quiz
•
9th - 12th Grade
10 questions
Advanced Java Study Guide

Quiz
•
11th - 12th Grade
14 questions
Python Basics - Year 8

Quiz
•
7th - 9th Grade
15 questions
Basics in Java

Quiz
•
9th - 12th Grade
15 questions
Java Math

Quiz
•
9th - 12th Grade
18 questions
Computer Science (Python)

Quiz
•
9th Grade
11 questions
JAVA QUIZ

Quiz
•
1st - 12th Grade
15 questions
Random, Parse and String Review

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
Discover more resources for
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
10 questions
Right Triangles: Pythagorean Theorem and Trig

Quiz
•
11th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade
24 questions
LSO - Virus, Bacteria, Classification - sol review 2025

Quiz
•
9th Grade
65 questions
MegaQuiz v2 2025

Quiz
•
9th - 12th Grade