Портал освітньо-інформаційних послуг «Студентська консультація»

  
Телефон +3 8(066) 185-39-18
Телефон +3 8(093) 202-63-01
 (093) 202-63-01
 studscon@gmail.com
 facebook.com/studcons

<script>

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

 

  ga('create', 'UA-53007750-1', 'auto');

  ga('send', 'pageview');

 

</script>

Інженерний калькулятор

Тип роботи: 
Курсова робота
К-сть сторінок: 
69
Мова: 
Українська
Оцінка: 

style="text-align: justify;">begin

x:=strtofloat(x2);
zn1:=strtozr(x2);
zn1:=ZRToLongInt(zn1,-1);
zn1:=abszr(zn1);
case y of
8:   begin
while   (ComparisonZR(zn1,inttozr(0))<>0) do
begin
zn2:=divzr(zn1,inttozr(8));
zn2:=ZRToLongInt(zn2,-1) ;
zn2:=multzr(zn2,inttozr(8));
zn2:= SubZR(zn1,zn2);
str:=zrtostr(zn2)+str;
zn1:=divzr(zn1,inttozr(8));
zn1:=ZRToLongInt(zn1,-1);
end;
end;
{while (trunc (x)<>0) do
begin
str:=floattostr(trunc (x) mod  8)+str;
x:=trunc (x) div 8;
end;
end;  }
2:   begin
while   (ComparisonZR(zn1,inttozr(0))<>0) do
begin
zn2:=divzr(zn1,inttozr(2));
zn2:=ZRToLongInt(zn2,-1) ;
zn2:=multzr(zn2,inttozr(2));
zn2:= SubZR(zn1,zn2);
str:=zrtostr(zn2)+str;
zn1:=divzr(zn1,inttozr(2));
zn1:=ZRToLongInt(zn1,-1);          
end;
end;
16:  begin
while   (ComparisonZR(zn1,inttozr(0))<>0) do
begin
zn2:=divzr(zn1,inttozr(16));
zn2:=ZRToLongInt(zn2,-1) ;
zn2:=multzr(zn2,inttozr(16));
zn2:= SubZR(zn1,zn2);
case zrtoint(zn2) of
10:str:='A'+str;
11:str:='B'+str;
12:str:='C'+str;
13:str:='D'+str;
14:str:='E'+str;
15:str:='F'+str;
else str:=zrtostr(zn2)+str;//str:=floattostr(trunc (x) mod 16)+str;
end;
zn1:=divzr(zn1,inttozr(16));
zn1:=ZRToLongInt(zn1,-1);           
end;
end;
end;
DestoDr:=str;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
trig:=false;
nev:=false;
meraisch:=10;
skob:=false;
sk:=0;
panel3.Caption:='';
memo1.Text:='0';
glob_check:=True; 
t:=0;
for i:=1 to 1000 do 
begin
a[i]:='|';
b[i]:='0';
end;
Memo1.Alignment := taRightJustify;
Memo1.MaxLength := 32;
Memo1.WantReturns := false;
Memo1.WordWrap := false;
speedbutton52.Enabled:=false;
speedbutton53.Enabled:=false;
speedbutton54.Enabled:=false;
speedbutton55.Enabled:=false;
speedbutton30.Enabled:=false;
end;
procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
MultiLineMemoToSingleLine(Memo1);
if (glob_check=true) then memo1.Text:='';
case key of
'0'..'9': ;
'a'..'z': chr(0);
#8: begin
if memo1.Text='' then memo1.Text:='0';
glob_check:=true;
end;
',': begin
for i:=length(memo1.Text) downto 1 do
if pos(memo1.Text[i],',')=1 then key:=chr(0);
end ;
else key:= chr(0);
end;
glob_check:=false;
end; }
procedure TForm1.SpeedButton17Click(Sender: TObject);
begin
if meraisch=10 then begin
if (memo1.Text='0') or (memo1.Text='') then begin memo1.Text:='0,'; end
else 
begin
j:=0;
for i:=length(memo1.Text) downto 1 do
if pos(memo1.Text[i],',')=1 then j:=j+1;
if (j=0) then  memo1.Text:=memo1.Text+',';
end ;
glob_check:=false;
end;
{if (memo1.Text='0') or (memo1.Text='') then begin memo1.Text:='0,'; end;
glob_check:=false; }
end;
procedure TForm1.SpeedButton5Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'6';
glob_check:=false;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'7';
glob_check:=false;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'8';
glob_check:=false;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'9';
glob_check:=false;
end;
procedure TForm1.SpeedButton11Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'4';
glob_check:=false;
end;
procedure TForm1.SpeedButton12Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'5';
glob_check:=false;
end;
procedure TForm1.SpeedButton13Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'1';
glob_check:=false;
end;
procedure TForm1.SpeedButton14Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'2';
glob_check:=false;
end;
procedure TForm1.SpeedButton15Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'3';
glob_check:=false;
end;
procedure TForm1.SpeedButton23Click(Sender: TObject);
begin
if (glob_check=true) then memo1.Text:='';
memo1.Text:=memo1.Text+'0';
glob_check:=false;
if meraisch=10 then
begin
if (strtofloat(memo1.Text)=0) then
begin
memo1.Text:='0';
glob_check:=true;
end;
end;
end;
procedure TForm1.SpeedButton56Click(Sender: TObject);
begin
skob:=false;
sk:=0;
panel3.Caption:='';
memo1.Text:='0';
glob_check:=True; 
trig:=false;
t:=0;
for i:=1 to 1000 do 
begin
a[i]:='|';
b[i]:='0';
end;
end;
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
case meraisch of
2: memo1.Text:=DrtoDes(memo1.Text,2);
8: memo1.Text:=DrtoDes(memo1.Text,8);
16: memo1.Text:=DrtoDes(memo1.Text,16);
end;
t:=t+1;
a[t]:=memo1.Text;
b[t]:='/';
if (((b[2]<>'0') and ((b[1]<>'+') and (b[1]<>'-')) and ((b[t-1]<>'+')and(b[t-1]<>'-') )) and (skob=false)) then
memo1.Text:=rezul(t-1);
glob_check:=true;
case meraisch of
2: memo1.Text:=DesToDr(memo1.Text,2);
8: memo1.Text:=DesToDr(memo1.Text,8);
16: memo1.Text:=DesToDr(memo1.Text,16);
end;
end;
procedure TForm1.SpeedButton6Click(Sender: TObject);
begin
case meraisch of
2: memo1.Text:=DrtoDes(memo1.Text,2);
8: memo1.Text:=DrtoDes(memo1.Text,8);
16: memo1.Text:=DrtoDes(memo1.Text,16);
end;
t:=t+1;
a[t]:=memo1.Text;
b[t]:='*';
if (((b[2]<>'0') and ((b[1]<>'+') and (b[1]<>'-')) and ((b[t-1]<>'+') and(b[t-1]<>'-') )) and (skob=false)) then
memo1.Text:=rezul(t-1);
glob_check:=true;
case meraisch of
2: memo1.Text:=DesToDr(memo1.Text,2);
8: memo1.Text:=DesToDr(memo1.Text,8);
16: memo1.Text:=DesToDr(memo1.Text,16);
end;
end;
procedure TForm1.SpeedButton16Click(Sender: TObject);
begin
case meraisch of
2: memo1.Text:=DrtoDes(memo1.Text,2);
8: memo1.Text:=DrtoDes(memo1.Text,8);
16: memo1.Text:=DrtoDes(memo1.Text,16);
end;
t:=t+1;
a[t]:=memo1.Text;
b[t]:='-';
if ((b[2]<>'0') and (skob=false))  then
memo1.Text:=rezul(t-1);
glob_check:=true;
case meraisch of
2: memo1.Text:=DesToDr(memo1.Text,2);
8: memo1.Text:=DesToDr(memo1.Text,8);
16: memo1.Text:=DesToDr(memo1.Text,16);
end;
end;
procedure TForm1.SpeedButton32Click(Sender: TObject);
begin
skob:=true;
t:=t+1;
b[t]:='(';
sk:=sk+1;
panel3.Caption:='(='+inttostr(sk);
end;
procedure TForm1.SpeedButton33Click(Sender: TObject);
begin
if (sk<>0) then
begin
sk:=sk-1;
panel3.Caption:='(='+inttostr(sk);
t:=t+1;
Фото Капча