With one cut across the middle of a pizza you can cut off


Can you please write the code in C++

With one cut across the middle of a pizza you can cut off half, that is, 50% of the pizza. With one cut at a 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. Reminder: If you did not derive the formula yourself, state in a comment where you got the formula.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: With one cut across the middle of a pizza you can cut off
Reference No:- TGS02894640

Expected delivery within 24 Hours