Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Selection and Iteration, 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 501–510 of 692
  1. 501
  2. 502
  3. 503
  4. 504
  5. 505
  6. 506
  7. 507
  8. 508
  9. 509
  10. 510

Question 501

Multiple choice Boolean Expressions
The variable x is an int. Which offered initial value of x is unchanged…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 502

Multiple choice Boolean Expressions
What is printed? int queued = 12; int batch; if (queued < 5) { batch = 1; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 503

Multiple choice Boolean Expressions
What is printed? int stock = 7; if (stock < 10) { stock += 8; } else if (stock < 20) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 504

Multiple choice Boolean Expressions
The boolean variables priority and urgent may have any values. Which assigned route value can never be produced by this code? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 505

Multiple choice Boolean Expressions
The int variable level is from 0 through 15 inclusive, and label is declared as String. The required labels are A for 0–3, B for 4–8, C for 9–12, and D for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 506

Multiple choice Boolean Expressions
A shipping rule requires fee 9 for every fragile item. A nonfragile item has fee 6 when mass > 5 and fee 2 otherwise. mass is a positive int and fragile is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 507

Multiple choice Boolean Expressions
An int variable x initially has a value from 0 through 12 inclusive. Which list contains all initial values for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 508

Multiple choice Boolean Expressions
The boolean variables voucher and member are initialized. Which condition is true exactly for the inputs that make this code print 19?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 509

Multiple choice Boolean Expressions
What is printed? The nested if statements intentionally have no braces. int x = -2; int y = 5;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 510

Multiple choice Boolean Expressions
What is printed? boolean allowed = false; boolean fast = true; int score = 4; if (allowed) { if (fast) { score…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 501 of 692
Page 51 of 70