
AP computer science unit 2
Authored by Sherry Dieterich
9th - 12th Grade
Used 809+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
About
This quiz covers fundamental programming concepts in Java, specifically focusing on AP Computer Science A Unit 2 material at the high school level (grades 9-12). The questions assess students' understanding of the Math class methods including Math.random() and Math.abs(), string concatenation and manipulation, method parameters and scope, method overloading principles, and code tracing through various programming constructs. Students need to demonstrate proficiency in predicting program output, understanding data type conversions and casting, recognizing valid method calls based on parameter types, and applying knowledge of variable scope rules. The core reasoning skills required include logical thinking about mathematical operations, understanding how Java handles string and numeric data types, and the ability to mentally execute code step-by-step to determine correct outputs. Created by Sherry Dieterich, a computer science teacher in the US who teaches grades 9-12. This assessment serves as an excellent formative evaluation tool for students progressing through their first programming course, allowing both teacher and students to identify areas where foundational concepts need reinforcement. The quiz works effectively as a warm-up activity to activate prior knowledge before introducing new programming concepts, as homework to reinforce classroom learning, or as review material before unit exams. Teachers can use individual question performance to guide targeted instruction on specific programming concepts that students find challenging. This quiz aligns with College Board AP Computer Science A standards, particularly those addressing primitive data types, arithmetic expressions, method design and implementation, and program analysis skills that form the foundation for more advanced programming concepts.
Content View
Student View
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
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
17 questions
Fil 102
Quiz
•
11th Grade
11 questions
Quick quiz on Motion
Quiz
•
10th Grade
11 questions
Asesmen Kelas XII Surat Lamaran Kerja
Quiz
•
11th - 12th Grade
10 questions
Conditional 0-3, Telling the Type
Quiz
•
9th Grade
17 questions
2nd Summative Test
Quiz
•
12th Grade
10 questions
Theme2: My Environment basic quiz
Quiz
•
9th Grade
10 questions
Q4 G10 ARTS Quiz #1
Quiz
•
10th Grade
10 questions
Human Rights Introduction
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for
20 questions
El Verbo IR Practice
Quiz
•
9th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
10 questions
Theme
Quiz
•
9th Grade
20 questions
Cell Organelles
Quiz
•
10th Grade
12 questions
Exponential Growth and Decay
Quiz
•
9th Grade