% compareGrottosPizzas.m  
% 09/03/2007   Michael Haggerty for CISC105 section 99
% Script to compute price per square inch of 12" vs 16" pizzas

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Assignment statments for input values %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% These Prices came from a phone call to Grottos Pizza in Newark on 09/03/2007
 
regPizzaPrice = 8.99;
regPizzaDiam = 12;

xLargePizzaPrice = 11.99;
xLargePizzaDiam = 16;

%%%%%%%%%%%%%%%%
% calculations %
%%%%%%%%%%%%%%%%

% convert diameter to radius

regPizzaRadius = regPizzaDiam / 2;
xLargePizzaRadius = xLargePizzaDiam / 2;

% compute area of both pizzas

regPizzaArea = pi * (regPizzaRadius ^ 2);
xLargePizzaArea = pi * (xLargePizzaRadius ^ 2);

% compute pricePerSquareInch

ppsiRegPizza = regPizzaPrice / regPizzaArea;
ppsixLargePizza = xLargePizzaPrice / xLargePizzaArea;
  
%%%%%%%%%%
% output %
%%%%%%%%%%

% For now, we output variables by just putting
% the name of the variable on a line with no semicolon.
% Later, we'll learn better ways of doing output (disp and fprintf).

ppsiRegPizza
ppsixLargePizza

% end of compareGrottosPizzas.m



