Verityprep
Question Bank · Unit 3

AP® Computer Science A Class Creation Practice Questions

Work through AP Computer Science A practice questions on Class Creation, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Subtopic: Writing Classes Clear filter

Questions 241–250 of 402
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

Multiple choice Writing Classes
A Ticket class has fields String event and double price.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 242

Multiple choice Writing Classes
Consider the following class: public class Stack { private ArrayList<Integer> data; public Stack() { data = new ArrayList<>(); } public void push(int val) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 243

Multiple choice Writing Classes
Consider this method in a class Timer with field private int seconds: public void addMinutes(int m) { seconds += m * 60; } public String toString() { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 244

Multiple choice Writing Classes
A class Circle has a private field double radius and the following method: public boolean isLargerThan(Circle other) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 245

Free response Writing Classes
Design and implement a complete class Scoreboard that tracks players and their scores in a game. The table below describes the required behavior: STATEMENT…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 246

Multiple choice Writing Classes
Consider the following class and client code. public class Counter { private int count; public Counter(int start) { count = start; } public void increment(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 247

Multiple choice Writing Classes
Consider the following class and client code. public class BankAccount { private double balance; public BankAccount(double initial) { balance = initial; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 248

Multiple choice Writing Classes
Consider this class. public class Accumulator { private int total; public Accumulator() { total = 0; } public int addAndGet(int value) { total += value; return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 249

Multiple choice Writing Classes
Consider the following class. public class StringProcessor { private String text; public StringProcessor(String t) { text = t; } public void removeFirst() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 250

Multiple choice Writing Classes
Consider the following class and client code. public class Point { private int x; private int y; public Point(int x, int y) { this.x = x; this.y = y; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 241 of 402
Page 25 of 41