Home Quizzes Quiz Detail
Practice Quiz

AP Computer Science Unit 9 Test Review Practice Questions

20 questions 5.0 rating Mobile friendly
$69.00

Unlock the full practice quiz

Get complete access to the questions, explanations and printable quiz resources.

Full access: unlock all quiz questions and explanations.
Printable review: access the full quiz PDF with correct answers after purchase.

About this Exam

Prepare with the AP Computer Science Unit 9 Test Review Practice Questions practice quiz. This question bank includes 20 questions covering public, double, balance, bankaccount, and implementation. Use it to review important concepts, identify knowledge gaps, and build confidence for the related exam, course, or assessment.

Sample Questions

Question 1
Questions 1–10 refer to the BankAccount , SavingsAccount , and CheckingAccount classes defined below: public class BankAccount { private double balance; public BankAccount() { balance = 0; } public BankAccount(double acctBalance) { balance = acctBalance; } public void deposit(double amount) { balance += amount; } public void withdraw(double amount) { balance -= amount; } public double getBalance() { return balance; } } public class SavingsAccount extends BankAccount { private double interestRate; public SavingsAccount() { /* implementation not shown */ } public SavingsAccount(double acctBalance, double rate) { /* implementation not shown */ } public void addInterest() //Add interest to balance { /* implementation not shown */ } } public class CheckingAccount extends BankAccount { private static final double FEE = 2.0; private static final double MIN_BALANCE = 50.0; public CheckingAccount(double acctBalance) { /* implementation not shown */ } /** FEE of $2 deducted if withdrawal leaves balance less * than MIN_BALANCE. Allows for negative balance. */ public void withdraw(double amount) { /* implementation not shown */ } } Of the methods shown, how many different nonconstructor methods can be invoked by a SavingsAccount object?
5
3
8
4
Explanation:
Correct answer: 4
Question 2
Questions 1–10 refer to the BankAccount , SavingsAccount , and CheckingAccount classes defined below: public class BankAccount { private double balance; public BankAccount() { balance = 0; } public BankAccount(double acctBalance) { balance = acctBalance; } public void deposit(double amount) { balance += amount; } public void withdraw(double amount) { balance -= amount; } public double getBalance() { return balance; } } public class SavingsAccount extends BankAccount { private double interestRate; public SavingsAccount() { /* implementation not shown */ } public SavingsAccount(double acctBalance, double rate) { /* implementation not shown */ } public void addInterest() //Add interest to balance { /* implementation not shown */ } } public class CheckingAccount extends BankAccount { private static final double FEE = 2.0; private static final double MIN_BALANCE = 50.0; public CheckingAccount(double acctBalance) { /* implementation not shown */ } /** FEE of $2 deducted if withdrawal leaves balance less * than MIN_BALANCE. Allows for negative balance. */ public void withdraw(double amount) { /* implementation not shown */ } } Which of the following correctly implements the default constructor of the SavingsAccount class? I interestRate = 0; super(); II super(); interestRate = 0; III super();
method overriding.
I, II, and III
II and III only
It will output the volume of the sphere or box, as intended.
Explanation:
Correct answer: II and III only
Question 3
Questions 1–10 refer to the BankAccount , SavingsAccount , and CheckingAccount classes defined below: public class BankAccount { private double balance; public BankAccount() { balance = 0; } public BankAccount(double acctBalance) { balance = acctBalance; } public void deposit(double amount) { balance += amount; } public void withdraw(double amount) { balance -= amount; } public double getBalance() { return balance; } } public class SavingsAccount extends BankAccount { private double interestRate; public SavingsAccount() { /* implementation not shown */ } public SavingsAccount(double acctBalance, double rate) { /* implementation not shown */ } public void addInterest() //Add interest to balance { /* implementation not shown */ } } public class CheckingAccount extends BankAccount { private static final double FEE = 2.0; private static final double MIN_BALANCE = 50.0; public CheckingAccount(double acctBalance) { /* implementation not shown */ } /** FEE of $2 deducted if withdrawal leaves balance less * than MIN_BALANCE. Allows for negative balance. */ public void withdraw(double amount) { /* implementation not shown */ } } Which is a correct implementation of the constructor with parameters in the SavingsAccount class?
method overriding.
It is not possible to declare a reference of type Player.
II and III only
super(acctBalance); interestRate = rate;
Explanation:
Correct answer: super(acctBalance); interestRate = rate;
Question 4
Questions 1–10 refer to the BankAccount , SavingsAccount , and CheckingAccount classes defined below: public class BankAccount { private double balance; public BankAccount() { balance = 0; } public BankAccount(double acctBalance) { balance = acctBalance; } public void deposit(double amount) { balance += amount; } public void withdraw(double amount) { balance -= amount; } public double getBalance() { return balance; } } public class SavingsAccount extends BankAccount { private double interestRate; public SavingsAccount() { /* implementation not shown */ } public SavingsAccount(double acctBalance, double rate) { /* implementation not shown */ } public void addInterest() //Add interest to balance { /* implementation not shown */ } } public class CheckingAccount extends BankAccount { private static final double FEE = 2.0; private static final double MIN_BALANCE = 50.0; public CheckingAccount(double acctBalance) { /* implementation not shown */ } /** FEE of $2 deducted if withdrawal leaves balance less * than MIN_BALANCE. Allows for negative balance. */ public void withdraw(double amount) { /* implementation not shown */ } } Which is a correct implementation of the CheckingAccount constructor? I super(acctBalance); II super(); deposit(acctBalance); III deposit(acctBalance);
method overriding.
super.withdraw(amount); if (getBalance() < MIN_BALANCE) super.withdraw(FEE);
Since Solid is abstract and its subclasses are nonabstract, polymorphism no longer applies when these classes are used in a program.
I, II, and III
Explanation:
Correct answer: I, II, and III
Question 5
Questions 1–10 refer to the BankAccount , SavingsAccount , and CheckingAccount classes defined below: public class BankAccount { private double balance; public BankAccount() { balance = 0; } public BankAccount(double acctBalance) { balance = acctBalance; } public void deposit(double amount) { balance += amount; } public void withdraw(double amount) { balance -= amount; } public double getBalance() { return balance; } } public class SavingsAccount extends BankAccount { private double interestRate; public SavingsAccount() { /* implementation not shown */ } public SavingsAccount(double acctBalance, double rate) { /* implementation not shown */ } public void addInterest() //Add interest to balance { /* implementation not shown */ } } public class CheckingAccount extends BankAccount { private static final double FEE = 2.0; private static final double MIN_BALANCE = 50.0; public CheckingAccount(double acctBalance) { /* implementation not shown */ } /** FEE of $2 deducted if withdrawal leaves balance less * than MIN_BALANCE. Allows for negative balance. */ public void withdraw(double amount) { /* implementation not shown */ } } Which is correct implementation code for the withdraw method in the CheckingAccount class?
It is not possible to declare a reference of type Player.
I, II, and III
super.withdraw(amount); if (getBalance() < MIN_BALANCE) super.withdraw(FEE);
II only
Explanation:
Correct answer: super.withdraw(amount); if (getBalance() < MIN_BALANCE) super.withdraw(FEE);

Ready to test your knowledge?

Buy Now to Access

Additional Information

AP Computer Science Unit 9 Test Review Practice Questions

This practice set contains 20 questions from the matching question bank and focuses on public, double, balance, bankaccount, and implementation. Work through each question carefully, review the provided solutions, and revisit topics that need more study before your next attempt.

This is an independent study resource intended for practice and review; it is not an official examination or an endorsement by any organization named in the title.

Frequently Asked Questions

This quiz contains a total of 20 practice questions carefully selected to test your knowledge on this subject.
Yes, you will have exactly 0 minutes to complete the exam. A countdown timer will be visible once you start.
Yes, you can retake this practice test as many times as you need. The questions and options may be randomized on subsequent attempts to ensure comprehensive learning.

Reviews

5.0

Based on 0 reviews

Leave a Review

No reviews yet. Be the first to review!