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
Q57: What is the output of the following
Q58: Which one of the following statements gives
Q59: What will be the value of the
Q60: What are the values of num1 and
Q61: Given the definition final double PI =
Q63: Which is the Java equivalent of the
Q64: What is the output of the following
Q65: Assume the following variables have been declared
Q66: Assuming that the user inputs a value
Q67: Assuming that the user inputs a value
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents