Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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 formula

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What is the difference between a licensor and a licensee?

Answered: 1 week ago

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago