Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please code in C++ Bronx Pizza needs a program to calculate the number of slices a pizza of any size can be divided into. They
Please code in C++
Bronx Pizza needs a program to calculate the number of slices a pizza of any size can be divided into. They also need the program to recommend the number of pizzas needed to feed a given number of people at a gathering. The program should perform the following steps: A) Ask the user for the diameter of the pizza(s) to be ordered. B) Ask the user how many people will attend. C) Ask the user how many slices the average person will cat. D) Calculate the number of slices that may be taken from a pizza of that size. Each slice should have a minimum area of 16.225 square inches. E) Calculate how many pizzas need to be ordered. F) Display a message telling the number of slices per pizza, and how many pizzas are needed. Use a named constant for pi (PI). All input and output is whole numbers only. To calculate this correctly, you need to know more about rounding in C++ round) will do an arithmetic round; round(2.4) is 2, and round(2.5) is 3 floor)rounds down: floor(2.9) is 2. ceil0 rounds up: ceil(2.1) is 3 Make your output look like this Enter pizza diameter (inches): 16 Enter number of people 13 Enter average number slices per person: 3 Each 16 inch pizza yields 12 slices. You should order 4 pizzas for 13 people Enter pizza diameter (inches) 12 Enter number of people: 8 Enter average number slices per person: 2 Each 12 inch pizza yields 6 slices.You should order 3 pizzas for 8 peopleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started