Write a program to ask for the chord

Assignment Help C/C++ Programming
Reference no: EM132101184

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.

Reference no: EM132101184

Questions Cloud

Show total distance traveled and total gas consumed : Allow the user to keep entering data in 5 minute increments until the user has no more data to enter. Show total distance traveled, total gas consumed.
Create a class line which consists of start -end coordinates : Create a class Line which consists of start and end coordinates, and line type.The default value for line type should be vertical.
Write a mips program that will read in a base : Write a MIPS program that will read in a base (as an integer) and a value (nonnegative integer but as an ASCII string) in that base.
Give the state of the array after it is max heapified : Give the state of the array after 3 "removes" (we are not really deleting anything) have been performed from the heap in phase 2 of heapsort.
Write a program to ask for the chord : 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.
Using recursion determine if the string is a palindrome : Using recursion, count how many times each of the letter "a" and "k" are repeated (There may be 0 a and 0 k in the string).
Deterinine the average codeword length : Determine the average information for this message. (You may ignore hyphens, spaces, and punctuation.)
How does the q cafe program aid : What do you see as the most important benefits of the program?
Different types of environmental variables : What are the different types of environmental variables and its importance?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd