All pastes #194041 Raw Edit

Pizza Sales

public text v1 · immutable
·published 2006-10-07 13:50 UTC
rendered paste body
Program Mamma_Pizza(input,output);
uses crt;


Const


 FixedCost  =0.75;                          (*The Making Cost*)
 BaseCost   =0.01;                          (*The Cost Per Square Inch*)
 Extras     =0.0025;                        (*The Cost Per Extra Ingredient*)



Var


   Price, Cost, Area:           Real;
   n, d:                        Integer; (* N are Extras | D is the Size*)


Begin
Clrscr;

   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('----//----Please Enter the Pizza Size! Sizes are 10 12 16 Inches----//----');

(*These Two Lines are to make 2 Spaces between the d Input and the WriteLn!
It is used through-out the Entire Program*)
   Writeln('');
   Writeln('');

   Write('Enter Pizza Size: '); Readln(d);
   Writeln('');
   Writeln('');
   Writeln('');
(*These Lines with d=X are to give a Different Responce Everytime a Different
Variable than the 3 Standard 10 12 16 Inches Variable is entered*)

   If d<=9
   Then Writeln('******** You have ordered an Extremely Small Pizza *********');

   If d=10
   Then Writeln('******** You have ordered a Small Pizza *********');

   If d=12
   Then Writeln('******** You have ordered a Medium Pizza *********');

   If d=13
   Then Writeln('****** You have ordered a Custom Made Medium Pizza ******');

   If d=14
   Then Writeln('****** You have ordered a Custom Made Medium Pizza ******');

   If d=15
   Then Writeln('****** You have ordered a Custom Made Medium Pizza ******');


   If d=16
   Then Writeln('******** You have ordered a Large Pizza **********');

    If d=17
   Then Writeln('******** You have ordered a Large Pizza **********');

    If d=18
   Then Writeln('******** You have ordered a Large Pizza **********');

    If d=19
   Then Writeln('******** You have ordered a Large Pizza **********');


   If d>=20
   Then Writeln('******** You have ordered an Extremely Large Pizza **********');


(* 7 Spaces Between the Last Readln(d) Statement and the New Readln(n) Statement*)

   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('');
   Writeln('----//----Please Enter the Number of Extra Ingredients you want to Add----//----');
   writeln('');
   Writeln('');
   Write('Enter Number of Extra Ingredients: ');  Readln(n);


   Area:=  3.14 * (d * d) /4;
   Cost:=  FixedCost + (BaseCost*Area) + (n*Extras*Area);
   Price:= 1.5 * Cost;


(*Line 1: 3.14 is the Greek P's Equivalent!
  Line 2: Instead of using the Entire Mathm we just use the AREA Var!
  Line 3: Cost from line 2 is used here as another Var in a Math Problem!
  *)

clrscr;

Writeln('');
Writeln('');
Writeln('Please pay ',price,' CYP for your order!');
Writeln('Thank you for Visiting Mamma Pizza ');


Readln;
end.