Witajcie . Mozecie mi pomóc z jednym programem napisanym troche chaotycznie i odrobine długim sposobem ale to nie to jest wazne chodzi o funkcjonalność .
Program Obwody_i_Pola;
Uses CRT;
var
a,b,c,d,h,Ob,P,g,f,r:real;
x:integer;
k:char;
Begin
TEXTCOLOR(White);
WriteLn('Czego obwód i pole chcesz obliczyc ?');
WriteLn('*********************************');
WriteLn('* Kwadratu * Prostokatu *');
WriteLn('* Wcisnij * Wcisnij *');
WriteLn('* 1 * 2 *');
WriteLn('*********************************');
WriteLn('* Trojkatu * Rownolegloboku *');
WriteLn('* Wcisnij * Wcisnij *');
WriteLn('* 3 * 4 *');
WriteLn('*********************************');
WriteLn('* Trapezu * Deltoidu *');
WriteLn('* Wcisnij * Wcisnij *');
WriteLn('* 5 * 6 *');
WriteLn('*********************************');
WriteLN('* Rombu * Kola *');
WriteLn('* Wcisnij * Wcisnij *');
WriteLn('* 7 ^ 8 *');
WriteLn('*********************************');
Read(x);
1:='!';
2:='@';
3:='#';
4:='$';
5:='%';
6:='^';
7:='&';
8:='*';
Case x of
'!' : WriteLn('Podaj długosc boku a');
ReadLn(a);
Ob:=a*4;
P:=a*a;
'@' : WriteLn('Podaj dlugosc boku a,b');
ReadLn(a,b);
Ob:=(2*a)+(2*b);
P:=a*b;
'#' : WriteLn('Podaj długosc podstawy a, dlugosc boku b,c i wysokosc h');
ReadLn(a,b,c,h);
Ob:=a+b+c;
P:=(a*h):2;
'$' : WriteLn('Podaj dlugosc boku a,b i wysokosc h');
ReadLn(a,b,h);
Ob:=(2*a)+(2*b);
P:=a*h;
'%' : WriteLn('Podaj dlugosc podstawy a,b');
WriteLn('Podaj dlugosc boku c,d');
WriteLn('Podaj długosc wysokosci h');
WriteLn(' a ');
WriteLn(' --- ');
WriteLn(' c/ \d ');
WriteLn(' ------- ');
WriteLn(' b ');
ReadLn(a,b,c,d,h);
Ob:=a+b+c+d;
P:=[(a+b)* h] : 2;
'^' : WriteLn('Podaj długosc boku a,b');
ReadLn(a,b);
clrscr;
WriteLn('Podaj dlugosc przekatnych g,f');
WriteLn('g to krotsza przekatna');
WriteLn('f to dluzsza przekatna');
ReadLn(g,f);
Ob:=(2*a)+(2*b);
P:=(g*f) : 2;
'&' : WriteLn('Podaj dlugosc boku a i wysokosc h');
ReadLn(a,h);
Ob:=4*a;
P:=a*a
'*' : WriteLn('Podaj promien kola r');
ReadLn(r);
Ob:=2*Pi*r;
P:=Pi*r*r;
Readln;
end;
WriteLn('Obwod wynosi: ',Ob:0:2);
WriteLn('Pole wynosi: ',P:0:2);
k:=readkey;
end.
Co musze tu poprawic aby wyniki wychodziły poprawnie i kompilacja sie udała .
jak zawsze mam problem z wartosciami case , wiem ze ma byc integer ale wyskakuje bład ;/