Pascal mania the morning, on this occasion I will be very happy to share one unique program, that program watchmaking. This program has a second element / second and minute. this program a little bit complicated for the beginner, but I think you all must have full control of the basics of pascal program code. please understand this code one by one. and just try to practice on your software Turbo Pascal 7.0.
Please follow the steps below carefully:
- Turbo pascal please open your program.
- select the file - new.
- And write the code as below.
- then compile - compile or alt + f9 to make sure there are no errors in your program code.
- If there are no errors please select run - run.
- Congratulations you can make the program his own watchmaking.
program jam_var;
uses crt,dos;
procedure resikilayar;
begin
clrscr;
end;
procedure garis1(p:integer);
var i:integer;
begin
for i:=1 to p do
write ('-');
end;
procedure garis2(p:integer);
var i:integer;
begin
for i:=1 to p do
write('=');
end;
procedure kotak(b,k:integer);
var i,j:integer;
begin
for i:=1 to b do
begin
for j:=1 to k do
begin
if (j=1) or (j=k) or (i=1) or (i=b) then
write('*')
else
write(' ');
end;
writeln;
end;
end;
procedure jam;
var h,m,s,hund:word;
begin
repeat
gettime(h,m,s,hund);
gotoxy(6,3);
writeln(' ');
gotoxy(6,3);
write(h,':',s);
delay(1000);
until keypressed;
end;
procedure rka(x,y:integer;teks:string);
var pj:integer;
begin
pj:=length(teks);
gotoxy(x-pj,y);
write(teks);
end;
function kuadrat(a:integer):real;
begin
kuadrat:=a*a;
end;
function pangkat(a,b:integer):real;
var i:integer;
p:real;
begin
p:=1;
for i:=1 to b do
p:=p*a;
pangkat:=p;
end;
begin
resikilayar;
clrscr;
textbackground(red);
textcolor(white);
kotak(5,18);
writeln;
textcolor(white);
kotak(10,38);
writeln;
garis1(38);
writeln;
garis2(38);
writeln;
writeln('7 kuadrat = ',kuadrat(7):2:0);
writeln('7 pangkat = ',pangkat(7,7):2:0);
jam;
end.
uses crt,dos;
procedure resikilayar;
begin
clrscr;
end;
procedure garis1(p:integer);
var i:integer;
begin
for i:=1 to p do
write ('-');
end;
procedure garis2(p:integer);
var i:integer;
begin
for i:=1 to p do
write('=');
end;
procedure kotak(b,k:integer);
var i,j:integer;
begin
for i:=1 to b do
begin
for j:=1 to k do
begin
if (j=1) or (j=k) or (i=1) or (i=b) then
write('*')
else
write(' ');
end;
writeln;
end;
end;
procedure jam;
var h,m,s,hund:word;
begin
repeat
gettime(h,m,s,hund);
gotoxy(6,3);
writeln(' ');
gotoxy(6,3);
write(h,':',s);
delay(1000);
until keypressed;
end;
procedure rka(x,y:integer;teks:string);
var pj:integer;
begin
pj:=length(teks);
gotoxy(x-pj,y);
write(teks);
end;
function kuadrat(a:integer):real;
begin
kuadrat:=a*a;
end;
function pangkat(a,b:integer):real;
var i:integer;
p:real;
begin
p:=1;
for i:=1 to b do
p:=p*a;
pangkat:=p;
end;
begin
resikilayar;
clrscr;
textbackground(red);
textcolor(white);
kotak(5,18);
writeln;
textcolor(white);
kotak(10,38);
writeln;
garis1(38);
writeln;
garis2(38);
writeln;
writeln('7 kuadrat = ',kuadrat(7):2:0);
writeln('7 pangkat = ',pangkat(7,7):2:0);
jam;
end.
0 Response to "how to create a program in TURBO PASCAL 7.0 times"
Post a Comment