Question: Programming language is C++. Show code and an example of the output on Putty when done. With one cut across the middle of a pizza
Programming language is C++. Show code and an example of the output on Putty when done.

With one cut across the middle of a pizza you can cut off half, that is, 50% of the pizza, different place you can cut off less than 50%. The length of the cut is called the "chord" and the piece removed is called the "segment." Look up (or derive yourself) the formula for the area of a segment in terms of the chord length and the diameter, and write a C++ program to ask for the chord length in inches and print out the percentage of a 14" pizza remaining after the segment is cut off. Running your program should look like this: Pizza diameter is 14". Enter chord length in inches: theta That cut leaves 100% of the pizza. Enter chord length in inches: 14 That cut leaves 50% of the pizza. Enter chord length in inches: 10.17 That cut leaves 90% of the pizza. Use while(cin >> chord) so the program will keep reading and calculating until end of file. Name your program hwlpr2.cpp. Reminder: If you did not derive the formula yourself, state in a comment where you got the formula
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
