Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program PracticeCalc;
- Uses
- crt;
- Var
- Response1:string;
- Response2:string;
- Response3:string;
- SurfaceArea:Real;
- Volume:Real;
- Height:Real;
- Radius:Real;
- Begin
- writeln('Would you like to calculate the volume of a cylinder?');
- writeln('Please answer with ''Yes/No''.');
- readln(Response1);
- If(Response1='Yes')then
- Begin
- writeln('Please enter a value for height.');
- readln(Height);
- writeln('Please enter a value for radius.');
- readln(Radius);
- Volume:=sqr(Radius)*(Pi)*(Height);
- writeln(Volume:10:2);
- readln();
- clrscr;
- writeln('Would you like to calculate the surface area of a cylinder?');
- writeln('Please enter with ''Yes/No''.');
- readln(Response2);
- End;
- If(Response1='No')Then
- Begin
- clrscr;
- writeln('Would you like to calculate the surface area of a cylinder?');
- writeln('Please enter with ''Yes/No''.');
- readln(Response3);
- End;
- If(Response3='Yes')Then
- Begin
- clrscr;
- writeln('Please enter a value for height.');
- readln(Height);
- writeln('Please enter a value for radius');
- readln(Radius);
- SurfaceArea:=10; //Add Surface Area forumla
- writeln(SurfaceArea);
- readln();
- End;
- If(Response3='No')Then
- Begin
- End;
- If(Response2='Yes')Then
- Begin
- clrscr;
- writeln('Please enter a value for height.');
- readln(Height);
- writeln('Please enter a value for radius');
- readln(Radius);
- SurfaceArea:=10; //Add Surface Area forumla
- writeln(SurfaceArea);
- readln();
- End;
- If(Response2='No')then
- Begin
- End;
- clrscr;
- write('Volume:');
- writeln(Volume:10:2);
- write('Surface area:');
- writeln(SurfaceArea:10:2);
- readln();
- End.
Advertisement
Add Comment
Please, Sign In to add comment