EmperorPhoenix

Fixed??

Sep 19th, 2015
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.69 KB | None | 0 0
  1. Program PracticeCalc;
  2.  
  3. Uses
  4.     crt;
  5.    
  6. Var
  7.     Response1:string;
  8.     Response2:string;
  9.     Response3:string;
  10.     SurfaceArea:Real;
  11.     Volume:Real;
  12.     Height:Real;
  13.     Radius:Real;
  14.    
  15. Begin
  16.     writeln('Would you like to calculate the volume of a cylinder?');
  17.     writeln('Please answer with ''Yes/No''.');
  18.     readln(Response1);
  19.    
  20.     If(Response1='Yes')then
  21.         Begin
  22.             writeln('Please enter a value for height.');
  23.             readln(Height);
  24.             writeln('Please enter a value for radius.');
  25.             readln(Radius);
  26.             Volume:=sqr(Radius)*(Pi)*(Height);
  27.             writeln(Volume:10:2);
  28.             readln();
  29.             clrscr;
  30.             writeln('Would you like to calculate the surface area of a cylinder?');
  31.             writeln('Please enter with ''Yes/No''.');
  32.             readln(Response2);
  33.         End;
  34.        
  35.     If(Response1='No')Then
  36.         Begin
  37.             clrscr;
  38.             writeln('Would you like to calculate the surface area of a cylinder?');
  39.             writeln('Please enter with ''Yes/No''.');
  40.             readln(Response3);
  41.         End;
  42.        
  43.     If(Response3='Yes')Then
  44.         Begin
  45.             clrscr;
  46.             writeln('Please enter a value for height.');
  47.             readln(Height);
  48.             writeln('Please enter a value for radius');
  49.             readln(Radius);
  50.             SurfaceArea:=10; //Add Surface Area forumla
  51.             writeln(SurfaceArea);
  52.             readln();
  53.         End;
  54.        
  55.     If(Response3='No')Then
  56.         Begin
  57.         End;   
  58.        
  59.     If(Response2='Yes')Then
  60.         Begin
  61.             clrscr;
  62.             writeln('Please enter a value for height.');
  63.             readln(Height);
  64.             writeln('Please enter a value for radius');
  65.             readln(Radius);
  66.             SurfaceArea:=10; //Add Surface Area forumla
  67.             writeln(SurfaceArea);
  68.             readln();
  69.         End;
  70.        
  71.     If(Response2='No')then
  72.         Begin
  73.         End;
  74.    
  75.     clrscr;
  76.     write('Volume:');
  77.     writeln(Volume:10:2);
  78.     write('Surface area:');
  79.     writeln(SurfaceArea:10:2);
  80.     readln();
  81. End.
Advertisement
Add Comment
Please, Sign In to add comment