
AP computer science unit 2

Quiz
•
9th - 12th Grade
•
Medium
Sherry Dieterich
Used 798+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Which line of code would set x = to a number between 50 and 100?
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 Wayground
11 questions
Python Quiz

Quiz
•
12th Grade
17 questions
JavaScript and Graphics

Quiz
•
12th Grade
10 questions
Programming with C++

Quiz
•
9th - 12th Grade
15 questions
Edublock -course assessment

Quiz
•
12th Grade
10 questions
Unit 1 Post Test: Basic Python

Quiz
•
9th - 12th Grade
10 questions
Introduction to C++ 2024/25

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

Quiz
•
9th Grade
16 questions
Python Beginner

Quiz
•
9th - 10th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
12 questions
Graphing Inequalities on a Number Line

Quiz
•
9th Grade
20 questions
Cell Organelles

Quiz
•
9th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
15 questions
Two Step Equations

Quiz
•
9th Grade