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 131–140 of 402
  1. 131
  2. 132
  3. 133
  4. 134
  5. 135
  6. 136
  7. 137
  8. 138
  9. 139
  10. 140

Question 131

Multiple choice Writing Classes
public class Coordinates { private int x, y; public Coordinates(int myX, int myY) { x = myX; y = myY; } public void setX(int myX) { x = myX; } public int getX()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 132

Multiple choice Writing Classes
public class Coordinates { private int x, y; public Coordinates(int myX, int myY) { x = myX; y = myY; } public void setX(int myX) { x = myX; } public int getX()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 133

Multiple choice Writing Classes
Consider the following class declaration. public class TestClass { private double value; public TestClass(double myValue) { value = myValue; } public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 134

Free response Writing Classes
A quadratic function is a polynomial of degree 2, which can be written in the form y = ax2 + bx + c, where a, b, and c represent real numbers and a ≠ 0. The…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 135

Multiple choice Writing Classes
A car dealership needs a program to store information about the cars for sale. For each car, they want to keep track of the following information: number of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 136

Multiple choice Writing Classes
public class TimeRecord { private int hours; private int minutes; // 0<=minutes<60 public TimeRecord(int h, int m) { hours = h; minutes = m; } /** @return the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 137

Multiple choice Writing Classes
Assume the following declarations have been made. private String s; private int n; public void changer(String x, int y) { x = x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 138

Multiple choice Writing Classes
The relationship between a class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 139

Multiple choice Writing Classes
Which of the following is a valid constructor declaration for the Cube class? I.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 140

Multiple choice Writing Classes
public class Student { private String name; private double gpa; public Student(String newName, double newGPA) { name = newName; gpa = newGPA; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 131 of 402
Page 14 of 41