#include using namespace std; // find the price per square inch of pizza // to compare large and small sizes for the best value // // Owen Astrachan // March 29, 1999 // double Cost(double radius, double price) // postcondition: returns the price per sq. inch { return price / (3.14159 * radius * radius); } int main() { double smallRadius, largeRadius; double smallPrice, largePrice; double smallCost, largeCost; // input phase of computation cout << "enter radius and price of small pizza "; cin >> smallRadius >> smallPrice; cout << "enter radius and price of large pizza "; cin >> largeRadius >> largePrice; // process phase of computation smallCost = Cost(smallRadius, smallPrice); largeCost = Cost(largeRadius, largePrice); // output phase of computation cout << "cost of small pizza = " << smallCost << " per sq.inch" << endl; cout << "cost of large pizza = " << largeCost << " per sq.inch" << endl; if (smallCost < largeCost) { cout << "SMALL is the best value " << endl; } else { cout << "LARGE is the best value " << endl; } return 0; }