Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 391–400 of 2,811
  1. 391
  2. 392
  3. 393
  4. 394
  5. 395
  6. 396
  7. 397
  8. 398
  9. 399
  10. 400

Question 391

Multiple choice Unit 1: Using Objects and Methods
public static void modify(int number, String text) { number = number * 2; text = text + "!"; } public static void display() { int value…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 392

Multiple choice Unit 1: Using Objects and Methods
public static int square(int n) { return n * n; } public static int compute(int x, int y)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 393

Multiple choice Unit 1: Using Objects and Methods
public static String combine(String first, String second) { return "" +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 394

Multiple choice Unit 1: Using Objects and Methods
public static int compute(int value) { double squared = Math.pow(value, 2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 395

Multiple choice Unit 1: Using Objects and Methods
The Book class is defined as follows: public class Book { private String title; private int pages; public Book(String t, int p) { title = t; pages = p; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 396

Multiple choice Unit 1: Using Objects and Methods
What is printed?
int a = 88;
a = a / 6;
a = a / 4;
a = a * 4 * 6;
System.out.println(a);
Pick an answer, then check it. The solution opens in a window.

Question 397

Multiple choice Unit 1: Using Objects and Methods
What is printed?
String s = "TRIGONOMETRY";
int k = s.indexOf("NOM");
String t = s.substring(k, k + 4);
System.out.println(t + " " + t.indexOf("O"));
Pick an answer, then check it. The solution opens in a window.

Question 398

Multiple choice Unit 1: Using Objects and Methods
What is printed?
int x = 73;
int a = x / 10;
int b = x % 10;
int y = b * 10 + a;
int z = y / 10 + y % 10;
System.out.println(z);
Pick an answer, then check it. The solution opens in a window.

Question 399

Multiple choice Unit 1: Using Objects and Methods
What is printed?
int p = 40, q = 9;
int d = p / q;
int r = p % q;
double val = Math.pow(d, r - 1) + Math.pow(r, d - 2);
System.out.println(val);
Pick an answer, then check it. The solution opens in a window.

Question 400

Multiple choice Unit 1: Using Objects and Methods
What is printed?
String s = "PARAMETRIC";
int n = s.indexOf("MET");
String out = s.substring(n - 2, n + 5);
System.out.println(out);
Pick an answer, then check it. The solution opens in a window.
Question 391 of 2,811
Page 40 of 282