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.

Subtopic: Using Objects Clear filter

Questions 81–90 of 546
  1. 81
  2. 82
  3. 83
  4. 84
  5. 85
  6. 86
  7. 87
  8. 88
  9. 89
  10. 90

Question 81

Multiple choice Using Objects
Consider the following code segment: String word = "Cafeteria"; for(/* missing condition */) { System.out.print(word.substring(i+1,i+2) + " "); } The code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 82

Multiple choice Using Objects
Consider the following method: public int countPs(String word) { int sum = 0; for (int i = 0;i < word.length();i++) { word = word.toLowerCase(); if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 83

Multiple choice Using Objects
Consider the following method: Consider the following method: public static void mix(String word, String letter) { int counter = 0; while(word.indexOf(letter) >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 84

Multiple choice Using Objects
Consider the following incomplete code segment, which is intended to increase the value of each digit in a String by one. For example, if num is 12345, then the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 85

Multiple choice Using Objects
What will be returned from this method if grades(80) was called? public String grades(int grade) { String letterGrade = ""; if (grade >= 90) { letterGrade + =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 86

Multiple choice Using Objects
What is the output of this code? String firstName = "Karel"; String lastName = "The Dog"; if (firstName.length() > lastName.length()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 87

Multiple choice Using Objects
Given the following Circle class public class Circle { private int radius; public Circle(int theRadius) { radius = theRadius; } public void setRadius(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 88

Multiple choice Using Objects
Given the following Circle class public class Circle { private int radius; public Circle(int theRadius) { radius = theRadius; } public void setRadius(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 89

Multiple choice Using Objects
Which of the following Boolean expressions will yield true after the code snippet executes?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 90

Multiple choice Using Objects
What will this code return given checkMethod(false, true)? public int checkMethod(boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 81 of 546
Page 9 of 55