//Xinnuo Wang CS1A chapter 3 , P.147, #18
//
/*******************************************************************************
*
* Caculate the number of slices a pizza
*-------------------------------------------------------------------------------
* This program to calculate the number of slices a pizza of any size
* can be divided into.
*
* computation is based on the formula:
* Area = π x r^2
*-------------------------------------------------------------------------------
* INPUT
* diameter : The diameter of the pizza in inches
* radius : The radius of the pizza in inches
* area : The area of the pizza
* OUTPUT
* numb : The number of slices a pizza of any size
*
*******************************************************************************/
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double diameter; //INPUT - The diameter of the pizza in inches
double radius; //INPUT - The radius of the pizza in inches
double area; //INPUT - The area of the pizza
double numb; //OUTPUT - The number of slices a pizza of any size
//
//Input Data
cout<< "Enter diameter of the pizza in inches" <<endl;
cin >> diameter;
//
//Compute Radius
radius = diameter/2;
//
//Compute Area
area = 3.14156 * pow(radius,2);
//
//Compute the Number of slices
numb = area/14.125;
//
//Output Result
cout << "The number of slices is :"<< numb<<endl;
return 0;
}