1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, TabNotBk, StdCtrls, jpeg, ExtCtrls;
type TForm1 = class(TForm) TabbedNotebook1: TTabbedNotebook; LQ_Eingabe: TLabel; LQ_Seitea: TLabel; EQ_seitea: TEdit; LQ_Seiteb: TLabel; EQ_seiteb: TEdit; LQ_seitec: TLabel; EQ_seitec: TEdit; LQ_Ergebnis: TLabel; LQ_Volumen: TLabel; LQ_Oberflaeche: TLabel; LQ_Diagonale: TLabel; I_Quader: TImage; BerechnungQ: TButton; I_Pyramide: TImage; EQ_Volumen: TEdit; EQ_Oberflaeche: TEdit; EQ_Diagonale: TEdit; EP_seitea: TEdit; EP_hoeheh: TEdit; EP_grundflaeche: TEdit; EP_Volumen: TEdit; EP_seitenhoehe: TEdit; BerechnungP: TButton; LP_seitea: TLabel; LP_hoeheh: TLabel; LP_grundflaeche: TLabel; LP_Volumen: TLabel; LP_seitenhoehe: TLabel; I_Kegel: TImage; LP_Eingabe: TLabel; LP_Ergebnis: TLabel; EK_hoehe: TEdit; EK_radius: TEdit; EK_kante: TEdit; EK_grundflaeche: TEdit; EK_volumen: TEdit; EK_oberflaeche: TEdit; LK_hoeheh: TLabel; LK_radiusr: TLabel; LK_seitenkantes: TLabel; LK_grundflaeche: TLabel; LK_volumen: TLabel; LK_oberflaeche: TLabel; LK_eingabe: TLabel; LK_ergebnis: TLabel; BerechnungK: TButton; ImageZylinder: TImage; EZ_hoehe: TEdit; EZ_radius: TEdit; EZ_grundflaeche: TEdit; EZ_volumen: TEdit; EZ_oberflaeche: TEdit; BerechnungZ: TButton; LZ_hoehe: TLabel; LZ_radius: TLabel; LZ_grundflaeche: TLabel; LZ_volumen: TLabel; LZ_oberflaeche: TLabel; LZ_eingabe: TLabel; LZ_ergebnis: TLabel; EndeQ: TButton; EndeP: TButton; EndeK: TButton; EndeZ: TButton; procedure BerechnungQClick(Sender: TObject); procedure BerechnungPClick(Sender: TObject); procedure BerechnungKClick(Sender: TObject); procedure BerechnungZClick(Sender: TObject); procedure EndeQClick(Sender: TObject); procedure TabbedNotebook1Change(Sender: TObject; NewTab: Integer; var AllowChange: Boolean); procedure EndeKClick(Sender: TObject); procedure EndeZClick(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BerechnungQClick(Sender: TObject); var a, b, c, v, o, e: real; begin
a := strtofloat (EQ_seitea.Text); b := strtofloat (EQ_seiteb.Text); c := strtofloat (EQ_seitec.Text);
v := round((a*b*c)*100)/100; o := round(2*(a*b+a*c+b*c)*100)/100; e := round(sqrt(sqr(a)+sqr(b)+sqr(c))*100)/100;
EQ_Volumen.Text := floattostr(v); EQ_Oberflaeche.Text := floattostr(o); EQ_Diagonale.Text := floattostr(e);
end;
procedure TForm1.BerechnungPClick(Sender: TObject); var a, h, G, V, hs: real; begin
a := strtofloat (EP_seitea.Text); h := strtofloat (EP_hoeheh.Text);
G := round((sqr(a))*100)/100; V := round((1/3*a*a*h)*100)/100; hs := round((sqrt(sqr(a/2)+sqr(h)))*100)/100;
EP_Grundflaeche.Text := floattostr(G); EP_volumen.Text := floattostr(V); EP_seitenhoehe.Text := floattostr(hs); end;
procedure TForm1.BerechnungKClick(Sender: TObject); var h, r, s, G, V, O: real; begin h := strtofloat (EK_hoehe.Text); r := strtofloat (EK_radius.Text); s := strtofloat (EK_kante.Text);
G := round((pi*r*r)*100)/100; V := round((pi/3*r*r*h)*100)/100; O := round((pi*r*(r+s))*100)/100;
EK_grundflaeche.Text := floattostr(G); EK_Volumen.Text := floattostr(V); EK_oberflaeche.Text := floattostr(O); end;
procedure TForm1.BerechnungZClick(Sender: TObject); var h, r, G, V, O: real; begin h := strtofloat (EZ_hoehe.Text); r := strtofloat (EZ_radius.Text);
G := round((pi*r*r)*100)/100; V := round((pi*r*r*h)*100)/100; O := round((2*pi*r*(r+h))*100)/100;
EZ_grundflaeche.Text := floattostr(G); EZ_volumen.Text := floattostr(V); EZ_oberflaeche.Text := floattostr(O); end;
procedure TForm1.EndeQClick(Sender: TObject); begin close end;
procedure TForm1.TabbedNotebook1Change(Sender: TObject; NewTab: Integer; var AllowChange: Boolean); begin close end;
procedure TForm1.EndeKClick(Sender: TObject); begin close end;
procedure TForm1.EndeZClick(Sender: TObject); begin close end;
end. |