subject

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 = 1 + numberOfDonuts / 12;
b. int numberOfBoxes = numberOfDonuts / 12 + numberOfDonuts % 12;
c. int numberOfBoxes = numberOfDonuts / 12;
d. int numberOfBoxes = (numberOfDonuts + 11) / 12;

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. after the loop terminates, it prints out, on a line by itself and separated by spaces, the sum of all the even integers read, the sum of all the odd integers read, a count of the number of even integers read, and a count of the number of odd integers read, all separated by at least one space. declare any variables that are needed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system.in); is given.
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
question
Computers and Technology, 24.06.2019 06:30
Me and category do i put them in because this is science
Answers: 1
You know the right answer?
When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be...
Questions
question
English, 08.04.2021 06:40
question
Mathematics, 08.04.2021 06:40
question
History, 08.04.2021 06:40
question
Mathematics, 08.04.2021 06:40