AP CSA Unit-Level MCQ

Code Tracing: Casting and Math.random

Practice mode with 50 Java-focused questions, immediate answer checks, and explanations.

For practice use only.

Code Tracing: Casting and Math.random MCQ Practice

Code Tracing: Casting and Math.random AP Computer Science A topic practice with 50 original Java MCQs and immediate explanations.

Question 1 of 50

Answered 0 of 50

Choose one answer.

What is printed by this Casting and Math.random code trace?

int completed = 18;
int bonus = 5;
int days = 3;
double average = (double) (completed + bonus) / days;
System.out.print(average);