Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this lab you will create a C++ console application that will calculate the number of slices that a pizza of any size can be

image text in transcribed

For this lab you will create a C++ console application that will calculate the number of slices that a pizza of any size can be divided into. In your solution you will create program variables and constant(s), accept input from the user, implement formulae by including and utilizing the math header file, and display results to the user. Below is an example of what the program output should look like: Prompt the user to enter the diameter of a pizza. This value will represent the diameter of the pizza in inches for the purpose of further calculations. Pizza diameters can be entered as real numbers. Calculate the number of slices that can be cut from a pizza that diameter. Each slice should be the same size and have an area as close to 14.125 inches as possible. Note that the number of slices should be a whole number. In order to determine the number of slices yielded, you may need to make some intermediate calculations relating to the area of a circle (A=pi r 2). You MUST implement the Math class in at least one of the calculations in your program. Specifically, use M_PI for access to pi, and the pow() method. Display the final result as a concatenated string message including the original pizza diameter in inches and the number of slices to be cut from that pizza as a whole number. Prompt the user to press any key and end the application. To be eligible for full marks on this or any lab in this course your application must conform to the requirements as outlined above and the course Style Guide, in this case making sure to include: Standard course naming rules and conventions. Appropriately declared data types for all possible variables and/or constant(s). Strict adherence to the IPO structure in the most efficient manner possible. Appropriate and complete program documentation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

List the types of reasoned arguments and write examples of each

Answered: 1 week ago