Multiple Choice
When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes.All donuts need to be in a box, so if you buy 13 donuts, you'll get 2 boxes with 12 in the first box and 1 in the second.If the integer variable numberOfDonuts contains the positive number of donuts purchased, which of the following will correctly give the number of boxes needed?
A) int numberOfBoxes = (numberOfDonuts + 11) / 12;
B) int numberOfBoxes = numberOfDonuts / 12;
C) int numberOfBoxes = 1 + numberOfDonuts / 12;
D) int numberOfBoxes = numberOfDonuts / 12 + numberOfDonuts % 12;
Correct Answer:

Verified
Correct Answer:
Verified
Q1: What is the correct way to invoke
Q2: What is wrong with the following code
Q3: What will be printed by the statement
Q5: Which statement is true about variable names
Q6: What is the value of Math.abs(-2)?<br>A)-2<br>B)0<br>C)2<br>D)4
Q7: Assume the following variable has been declared
Q8: Which of the following options declares a
Q9: Which is the Java equivalent of the
Q10: Assume the following variables have been declared
Q11: Which is the Java equivalent of the