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 561–570 of 776
  1. 561
  2. 562
  3. 563
  4. 564
  5. 565
  6. 566
  7. 567
  8. 568
  9. 569
  10. 570

Question 561

Multiple choice Primitive Types
Consider the following code segment. int a = 9; int b = 2; double x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 562

Multiple choice Using Objects
Consider the following code segment. String p = "trace"; String q = p.substring(1, 4); String r = "rack"; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 563

Multiple choice Using Objects

Consider the following code segment.

String s = "method";
String t = s.substring(2);
int value = t.length() + s.indexOf(t.substring(1, 3));

What value is stored in value?

Pick an answer, then check it. The solution opens in a window.

Question 564

Multiple choice Using Objects
Consider the following code segment. double r = Math.pow(2, 3)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 565

Multiple choice Using Objects
Consider the following code segment. String s = "starter"; String t = s.substring(0, 3) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 566

Free response Using Objects
This problem involves the design of two classes that work together to analyze the letters in a word. The following LetterFrequency class is provided. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 567

Free response Using Objects
This problem involves writing methods that examine a password for security requirements. The declaration of the PasswordChecker class is shown below. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 568

Free response Using Objects
This problem involves writing methods that format and inspect a sentence. The declaration of the TextFormatter class is shown below. public class TextFormatter…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 569

Free response Primitive Types
This question simulates the discharge of a phone battery as apps are used over the course of a day. The following BatterySimulator class tracks the current…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 570

Free response Primitive Types
This question involves a multi-floor parking garage where vehicles can occupy a single spot or a block of consecutive spots. Each floor of the garage has 30…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 561 of 776
Page 57 of 78