Skip to main content

Java Topic Practice

Casting and Math.random

Casting and Math.random MCQ Practice

Question 1 of 15

Answered 0 of 15

Choose one answer.

What is printed by the following code segment?

int completed = 18;
int bonus = 5;
int days = 3;
double average = (double) (completed + bonus) / days;
System.out.printf("%.6f", average);
Choose one answer.