
Unit 2 AP CSA Practice Quiz Part 1
Authored by Madelynn Andino
Other
9th - 12th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
29 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A teacher has created a Student class. The class contains the following.
An int variable called grade to represent the student’s grade level
A String variable called name to represent the student’s name
A double variable called average to represent the student’s grade point average
A method called updateAverage that updates the student’s average.
The object greg will be declared as type Student.
Which of the following descriptions is accurate?
greg is an instance of the Student class.
greg is an instance of three attributes.
greg is an instance of the updateAverage method.
Student is an instance of the greg object.
updateAverage is an instance of the Student class.
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Consider the following description of the Thing class which includes two constructors.
public Thing() – Constructs a Thing object that uses a default value to represent a color
public Thing(String setColor) – Constructs a Thing object that uses setColor to represent a color
Which of the following code segments, when appearing in a class other than Thing, will create an instance variable of a Thing object with a value of null ?
private Thing someThing = new Thing()
private Thing someThing;
private Thing someThing = new Thing("Green");
private Thing("Green");
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A student has created a Book class. The class contains variables to represent the following.
An int variable called pages to represent the number of pages
A boolean variable called isHardcover to indicate whether or not the book is hardcove
The object story will be declared as type Book.
Which of the following descriptions is accurate?
An instance of the story class is Book.
An instance of the Book object is story.
An attribute of the story object is isHardcover.
An attribute of the Book instance is story.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Answer the following
An attribute of the penelope object is email.
An attribute of the mrsPatel object is studentName.
An attribute of the mrsPatel object is email.
An attribute of the penelope object is Parent.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Answer the following
VetRecord(String name, int weight, int age)
VetRecord(String name, int age)
VetRecord(int age, boolean needsVac)
VetRecord(int age, int weight)
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Answer the following
I only
II only
I and II only
II and III only
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Answer the following
I only
II and III only
None of the code segments will compile.
II only
Answer explanation
Correct. Code segment I will not compile. To call a nonstatic method outside the MagicNumber class, a MagicNumber object must be created and the nonstatic method must be called using the dot operator on the object name. Code segment II will compile successfully, as it first creates an object of the class MagicNumber and then uses the dot operator to call nonstatic methods that manipulate an instance variable of that object. Code segment III will not compile because the variable n2 has not been properly declared and initialized.
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
25 questions
Adjectives and prepositions, collocations
Quiz
•
10th Grade
26 questions
Apparel I-3.03
Quiz
•
9th - 12th Grade
30 questions
HCT CB Level 1 List 3 ADWC
Quiz
•
4th Grade - University
25 questions
Higher Business Management
Quiz
•
12th Grade
24 questions
Handling and Storing Meats
Quiz
•
11th Grade
24 questions
Gaming Quiz Round 2
Quiz
•
9th - 12th Grade
25 questions
QUIZ 2. ESP 9 QUARTER 4
Quiz
•
9th Grade - University
25 questions
PCIS 12th Economics - Demand and Supply
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Other
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
20 questions
El Verbo IR Practice
Quiz
•
9th Grade
23 questions
TSI Math Vocabulary
Quiz
•
10th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
Graphing Inequalities
Quiz
•
7th - 9th Grade
10 questions
Cell Organelles and Their Functions
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
15 questions
Combine Like Terms and Distributive Property
Quiz
•
8th - 9th Grade