subject

Here is this story behind the code: you must find out from the user how many of their friends are coming over (must include yourself), how many cans they want to drink of beer, and how many packs are needed. I need help with the calculation as I am a bit off.
Example: Friends - 10 (including self)
Beer Cans needs - 14

With this being said, the beer only comes in 6-packs. So here is what I have so far:
10 people * 14 cans = 140 cans

140 cans / 6 packs = 23.333 packs (but this is suppose to be 24 packs from what the instructor has included in the example because you can't obviously just buy 23.3 packs, so what is this equation supposed to be in order to get 24 and not 23 as an int, NOT a double)

Overall, I don't really need any coding answers, but mostly calculations for finding the packs needed.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:20, khenalilovespandas
Number of megabytes of ram in a computer. qualitative or quantitative? because
Answers: 3
image
Computers and Technology, 22.06.2019 14:50, williamsgregg5214
Drag each label to the correct location on the image list the do’s and don’ts of safeguarding your password. a. keep yourself logged in when you leave your computer. b. don’t write your password down and leave it where others can find it. c. share your password with your friends. d.each time you visit a website, retain the cookies on your computer. e. use a long password with mixed characters.1. do's 2. don'ts
Answers: 2
image
Computers and Technology, 22.06.2019 20:30, fickllyd000
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
image
Computers and Technology, 23.06.2019 19:40, Latoyajenjins1789
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system. currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system. currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system. currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
Here is this story behind the code: you must find out from the user how many of their friends are co...

Questions in other subjects:

Konu
Mathematics, 04.06.2020 14:07
Konu
Mathematics, 04.06.2020 14:07