Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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: 0 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 hw1pr2.cpp. Reminder: If you did not derive the formula yourself, state in a comment where you got the formulaStep 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