subject

Given the number of people attending a pizza party, output the number of needed pizzas(not number of slices) and total cost. For the calculation, assume that people eat 2 slices on average and each pizza has 12 slices and costs $14.95. Output each floating-point value with two digits after the decimal point, using the precision format string in the printf() function call.

Example: printf("$%.3lf\n", 12.94444); would print "$12.944" and a new line.

The challenge to getting all credit will be to ensure that the number of pizzas is rounded upwards so that there is enough pizza for the average consumption of 2 slices per person rather than the total number of slices needed. For example, 6 people need 1 pizza….what about 7 people?

Ex: If the input is:

4
the output is:

Pizzas: 1
Cost: $14.95
Hint: Use the ceil() function to round up the number of pizzas so that enough pizzas are ordered.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:20
Write a select statement that returns product name, customer first name, customer last name, channel description, and amount sold for all the sales. make sure to returns sales even if there is no information on the customer, product, or channe
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
When building customer relationships through email what should you not do? question 2 options: utilize proper grammar, spelling, and punctuation type in all capital letters use hyperlinks rather than attachments respond to all emails within 24 hours
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The great length of north america causes the climate to be varied. true false
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
You know the right answer?
Given the number of people attending a pizza party, output the number of needed pizzas(not number of...
Questions
question
Mathematics, 21.10.2020 20:01
Questions on the website: 13722367