Computers and Technology
03.02.2020 04:51
244
309
8
Solved by an expert

Here is this story behind the code: you must find out from the user how many of

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.
Show Answers
danielboek
danielboek
4,6(65 marks)

10 people

14 cans wanted

total = 140/6 =23.333

10

Explanation:

 //float value is 23.333;  

  var x = 23.3333;  

  var z = Math.round(x);  

  document.write("Converted value of " + x + " is " + z);  

 

Output :

Converted value of 23.333 is 5

Explanation:

SRTBANDIT4655
SRTBANDIT4655
4,9(65 marks)

I would go with A

Explanation:

Popular Questions about the subject: Computers and Technology

Roger wants to check whether a user has or has not entered data in a text field....
Computers and Technology
31.07.2020 11:40
How to update page using css whenever a hyperlink is clicked....
Computers and Technology
08.10.2020 14:18
A CSIRT model in which a single CSIRT handles incidents throughout the organization...
Computers and Technology
04.06.2022 04:59
What is the difference between the dom api and the html dom api....
Computers and Technology
12.10.2020 11:43
Which type of technology imitates hardware without relying on the CPU being able...
Computers and Technology
03.01.2021 12:14
How to turn robot voice like real human voice....
Computers and Technology
12.09.2021 01:45
How to add a space between paragraphs in html....
Computers and Technology
28.03.2021 21:48
Perform an online search about the booting process of a computer and list all the...
Computers and Technology
18.01.2020 05:02
Why don t we use a for each loop when doing a sequential (linear) search?...
Computers and Technology
09.07.2022 21:24
In the print dialog box, the box lets you specify the slides to be printed. a. print...
Computers and Technology
02.11.2022 16:53

New questions by subject

Who are the top 10 richest people in the world answer...
Business
12.11.2021 17:39
If a person paddling only on the left side of a boat . in which direction will the...
Physics
14.05.2021 04:28
Lily estimates a quotient of 120 and found an actual quotient of 83. what she should...
Mathematics
25.03.2021 12:21
An individual s is observable in his or her...
Social Studies
26.06.2020 19:06
Angel s parents always wanted him to be part of the family business and angel never...
Social Studies
10.05.2021 06:58
Ageographically expressive political system that acknowledges the existence of regional...
Social Studies
14.10.2022 04:32
Body motions during speaking are properly referred to as:...
Biology
05.12.2022 15:10
Use the distributive property to remove the parentheses?...
Mathematics
10.12.2021 18:05
#
#
#
#
# #

We expand our knowledge with many expert answers