
AP computer science unit 2
Quiz
•
9th - 12th Grade
•
Practice Problem
•
Medium
Sherry Dieterich
Used 807+ times
FREE Resource
About this resource
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.
See more
Enhance your content in a minute
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
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
10 questions
PTS 8 GANJIL 2023/2024
Quiz
•
9th Grade
10 questions
Catcher in the Rye chs. 1-2
Quiz
•
9th - 12th Grade
10 questions
RUN BTS!
Quiz
•
7th Grade - University
10 questions
OCR Business 2.2 Market Research
Quiz
•
10th - 11th Grade
8 questions
MODALS (Giving advice)
Quiz
•
8th - 11th Grade
11 questions
Algebra 1 Final Exam
Quiz
•
9th Grade
17 questions
1 Physics - Waves Review
Quiz
•
11th Grade
10 questions
Grammar Revision Quiz
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
18 questions
Thanksgiving Trivia
Quiz
•
4th - 12th Grade
20 questions
Thanksgiving
Quiz
•
KG - 12th Grade
20 questions
Pythagorean Theorem and Their Converse
Quiz
•
8th - 9th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
10 questions
Thanksgiving Trivia Challenge: Test Your Knowledge!
Interactive video
•
6th - 10th Grade
