Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice questions on Using Objects and Methods, 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.

Questions 251–260 of 776
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

Multiple choice Using Objects
Consider the following program that uses the IntPair class. public class IntPair { private int firstValue; private int secondValue; public IntPair(int first,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 252

Multiple choice Using Objects
public class Name { private String firstName; private String lastName; public Name(String first, String last) / / constructor { firstName = first; lastName =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 253

Multiple choice Using Objects
public class Name { private String firstName; private String lastName; public Name(String first, String last) / / constructor { firstName = first; lastName =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 254

Multiple choice Primitive Types
Consider the following code segment: int a = 10; double b = 3.7; int c = 4; int x = (int) (a + b); double y = (double) a / c;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 255

Multiple choice Primitive Types
Consider the following code segment. int var = 12; var = var % 7; var--;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 256

Multiple choice Primitive Types
Consider the following code segment. int count = 5; double multiplier = 2.5; int answer = (int)(count * multiplier);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 257

Multiple choice Primitive Types
3. Consider the following code segment. double x = 3.6; double y = 2; int a = 5, b =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 258

Multiple choice Primitive Types
Consider the task of finding the average score in a game. int sum = / / a number representing the sum of all of the scores int count…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 259

Multiple choice Primitive Types
Consider the code segment. int a = 16, b = 0; double c = a / b; The…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 260

Multiple choice Using Objects
Which print statement will produce the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 251 of 776
Page 26 of 78