//Ava Huntington CS1A Chapter 3 Homework P. 147, #18
//
/*******************************************************************************
* CALCULATE PIZZA SLICES
* _____________________________________________________________________________
* This program will calculate the number of evenly sized slices of pizza
* given the pizzas diameter.
* _____________________________________________________________________________
* INPUT
* pizzaDiameter: Given diameter of pizza
* pizzaArea: Area of pizza based on given diameter
* sliceArea: Specific area of a single pizza slice
* pi: Definition of Pi
*
* OUTPUT
* numberOfSlices: Number of pizza slices based on diameter of pizza
******************************************************************************/
#include <iostream>
#include <iomanip>
#include<cmath>
using namespace std;
int main()
{
float pizzaDiameter; //INPUT : Given of diameter of pizza
float pizzaArea; //INPUT : Area of pizza based on diameter
float sliceArea; //INPUT : Specified area of a pizza slice
float pi; //INPUT : Definition of Pi
float numberOfSlices; //OUTPUT : User chosen city
//Prompt to aquire diameter of pizza
cout << "What is the diameter of the pizza in inches? "<<endl;
cin >> pizzaDiameter;
//Defining pi
pi = 3.14159;
//Equation to find the area of the pizza
pizzaArea = pow((pi*(pizzaDiameter/2)),2);
//Defining the area of a slice of pizza
sliceArea = 14.125;
//Equation to find amount of slices
numberOfSlices = pizzaArea/sliceArea;
//Final ouput, slices of pizza based on given diameter
cout << "Based on the given diameter, the pizza can be divided into "<<
setprecision(3)<<numberOfSlices<< " slices."<<endl;
return 0;
}