type cone = record height: real; radius: real; end; procedure Input(var c: cone); begin write('Enter the height of cone: '); readln(c.height); write('Enter the radius of cone: '); readln(c.radius); writeln; end; function Square(c: cone): real; begin Square := Pi * c.radius * Sqrt(c.height * c.height + c.radius * c.radius); end; function Volume(c: cone): real; begin Volume := 1 / 3 * Pi * c.radius * c.radius * c.height; end; var c: cone; begin Input(c); writeln('The square of cone is ', Square(c):1:3); writeln('The volume of cone is ', Volume(c):1:3); readln; end. |