
APCSA Diag
Authored by Johnson Ting
Computers
9th - 12th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider this inheritance hierarchy, in which Novel and Textbook are subclasses of Book. Which of the following is a false statement about the classes shown?
The Textbook class can have private instance variables that are in neither Book nor Novel.
Each of the classes—Book, Novel, and Textbook—can have a method computeShelfLife, whose code in Book and Novel is identical, but different from the code in Textbook.
If the Book class has private instance variables title and author, then Novel and Textbook cannot directly access them.
Both Novel and Textbook inherit the constructors in Book.
If the Book class has a private method called readFile, this method may not be accessed in either the Novel or Textbook classes.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A programmer is designing a program to catalog all books in a library. He plans to have a Book class that stores features of each book: author, title, isOnShelf, and so on, with operations like getAuthor, getTitle, getShelfInfo, and setShelfInfo. Another class, LibraryList, will store an array of Book objects. The LibraryList class will include operations such as listAllBooks, addBook, removeBook, and searchForBook. The programmer plans to implement and test the Book class first, before implementing the LibraryList class. The programmer’s plan to write the Book class first is an example of
top-down development.
bottom-up development.
procedural abstraction.
information hiding
a driver program.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The color of a pixel can be represented using the RGB (Red, Green, Blue) color
model, which stores values for red, green, and blue, each ranging from 0 to 255.
How many bits (binary digits) would be needed to represent a color in the RGB
model?
8
16
24
32
40
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following represents correct /* implementation */ code for the constructor
in the Card class?
suit = cardSuit;
value = cardValue;
cardSuit = suit;
cardValue = value;
Card = new Card(suit, value);
Card = new Card(cardSuit, cardValue);
suit = getSuit();
value = getValue();
5.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Consider the implementation of a writeDeck method that is added to the Deck
class.
/** Write the cards in deck, one per line. */
public void writeDeck()
{
/* implementation code */
}
Which of the following is correct /* implementation code */?
System.out.println(deck);
for (Card card : deck)
System.out.println(card);
for (Card card : deck)
System.out.println((String) card);
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Refer to the following method that finds the smallest value in an array.
Which replacement(s) for /* some value */ will always result in correct execution
of the findMin method?
I only
II only
III only
I and III only
II and III only
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following loop, where n is some positive integer.
for (int i = 0; i < n; i += 2)
{
if (/* test */)
/* perform some action */
}
In terms of n, which Java expression represents the maximum number of times
that /* perform some action */ could be executed?
n / 2
(n + 1) / 2
n
(n - 1)
(n - 1) / 2
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
40 questions
Computer Network
Quiz
•
12th Grade - University
45 questions
3rd Preliminary Exam - TLE-ICT_CSS_2025
Quiz
•
10th Grade
40 questions
Chapter 2 – Hardware
Quiz
•
12th Grade
35 questions
RPL-Web-02 (Web)
Quiz
•
12th Grade - University
36 questions
ÔN TẬP CUỐI KÌ 1 MÔN TIN 10
Quiz
•
10th Grade
40 questions
Socrathecs 2
Quiz
•
1st - 12th Grade
35 questions
Revision: IT for Business
Quiz
•
10th Grade
40 questions
MS office 2016
Quiz
•
1st Grade - Professio...
Popular Resources on Wayground
8 questions
Spartan Way - Classroom Responsible
Quiz
•
9th - 12th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
3 questions
Integrity and Your Health
Lesson
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
9 questions
FOREST Perception
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
Discover more resources for Computers
10 questions
Navigating Digital Citizenship and Online Safety
Interactive video
•
6th - 10th Grade
20 questions
Computer / Internet Companies
Quiz
•
9th Grade
10 questions
Exploring the Basics of Google Sheets
Interactive video
•
9th Grade
10 questions
Exponent Rules
Quiz
•
9th - 12th Grade
20 questions
JavaScript - Karel
Quiz
•
9th - 10th Grade