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
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
Q17: At what point in the problem-solving process
Q18: One way to avoid round-off errors is
Q19: Which of the methods below are static
Q41: Assume the following variables have been declared
Q42: What is the value of the following
Q106: What happens to the fractional part when
Q111: Which one of the following is a
Q123: Which one of the following statements can