//Andrew Alspaugh CS1A Chapter 3. P. 147. #18
//
/*****************************************************************************
*
* Number of Slices Per Pizza
* __________________________________________________________________________
* This program calculates how many slices any pizza can be divided into
*
* Equation used for solving = pi(d/2)^2/14.125
* _________________________________________________________________________
* INPUT:
* Diameter :Diameter of Pizza
* OUTPUT:
* Area :Area of Pizza
* Slices :Slices per Pizza
****************************************************************************/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double Diameter; //Input Diameter
double Area; //Output Area
double Slices; //Output Slices
//Input Diameter
cout<<"enter diameter of pizza"<<endl;
cin>>Diameter;
//Use Diameter to Solve for Area
Area = M_PI * pow((Diameter/2),2.0);
cout<<"Area of Pizza is "<<Area<<endl;
//Divide Area by 14.125 to Solve for Slices
Slices = Area / 14.125;
cout<<"This Pizza has "<< Slices << " slices";
return 0;
}