Tampilkan postingan dengan label Pascal. Tampilkan semua postingan
Tampilkan postingan dengan label Pascal. Tampilkan semua postingan

Script Progam Rekaman (Pascal)

Script Progam Rekaman mengunakan bahasa Pascal
Nasabah Bank


uses wincrt;
Const
dmax=100;

type
recNasabah=record
NoAkun : string[10];
Nama : string[20];
Alamat : string[20];
Kota : string[10];
NoTelp : String[11]
end;

var
a:array[1..dmax] of recNasabah;
i,j,bd:integer;


Procedure Tampilan;
begin
clrscr;
gotoxy (5,2); write('Bank Sendiri Indonesia');
gotoxy (5,3); write('Input data Nasbah');
gotoxy (5,5); write('-------------------------------------');
gotoxy (5,7); write('Nomor Rekening :');
gotoxy (5,8); write('Nama :');
gotoxy (5,9); write('Alamat :');
gotoxy (5,10);write('Kota :');
gotoxy (5,11);write('No. Telp/ HP :');
gotoxy (5,13);write('-------------------------------------');
gotoxy (5,14);write('Data ke- dari ',bd,' ');
gotoxy (5,15);write('-------------------------------------');
end;

begin
Tampilan;
bd:=dmax;
gotoxy (5,14); Write('Banyak data yang akan masukan ? '); readln(bd);
for i:=1 to bd do
begin
Tampilan;
gotoxy (13,14);write(i);
gotoxy (25,7); readln(a[i].NoAkun);
gotoxy (25,8); readln(a[i].Nama);
gotoxy (25,9); readln(a[i].Alamat);
gotoxy (25,10);readln(a[i].Kota);
gotoxy (25,11);readln(a[i].NoTelp);
end;
clrscr;
gotoxy (1,2); write('Bank Sendiri Indonesia');
gotoxy (1,3); write('Data Nasabah');
gotoxy (1,4); write('--------------------------------------------------------------------------------');
gotoxy (1,6); write('--------------------------------------------------------------------------------');

gotoxy (1,5); write('No');
gotoxy (5,5); write('Rekening');
gotoxy (16,5);write('Nama');
gotoxy (37,5);write('Alamat');
gotoxy (58,5);write('Kota');
gotoxy (69,5);write('Telepon');
writeln;
for i:=1 to bd do
begin
gotoxy (1,7+i) ;writeln(i);
gotoxy (5,7+i) ;write(a[i].NoAkun);
gotoxy (16,7+i);write(a[i].Nama);
gotoxy (37,7+i);write(a[i].Alamat);
gotoxy (58,7+i);write(a[i].Kota);
gotoxy (69,7+i);write(a[i].NoTelp);
end;
gotoxy (1,9+i); write('--------------------------------------------------------------------------------');
gotoxy (1,10+i); write('Total data =',i);
readln;
end.

Tugas Kuliah - Animasi Hurup

Script progam ini masih dalam perbaikan, sampai diterbitkan masih terdapat beberapa kesalahan. Sudah lama tidak pernah menggunakan bahasa Pascal jadi lumayan harus mengingat ingat kembali.

Saya mempelajari Bahasa Pascal sekitar tahun 1999 dan baru kali ini membuka kembali lembaran ingatan masa lalu.

uses wincrt;
Const
Max=200;
type
PKar = ^RecKar;
RecKar = Record
Kar : Char;
Next : PKar;
end;
Var
Jml : byte;
Head, Tail, Now : Pkar;

Procedure Push(Ch:Char);
begin
New(Now);
if Head=Nil Then
Head:=Now
else
Tail^.Next:=Now;
Tail:=Now;
Tail^.Next:=Nil;
Now^.kar:=Ch;
end;

Procedure Pop;
Begin
Now:=Tail;
While (Tail^.next<>Now) And (Tail<>nil) do Tail:=Tail^.Next;
Dispose(Now);
Dec(Jml);
if Tail=Nil then Head:=Nil;
end;

Procedure Input;
Var
i:byte;
Kal:String[50];
begin
clrscr;
Jml:=1;
write('Masukan Karakter= ');
readln(Kal);
if Kal <>'' then
for i:= 1 to length(Kal) do
begin
Push(Kal[i]);
inc(Jml);
end
else
exit;
end;

Procedure Anim;
Var
ch:char;
x,y,i,Tx,Ty:byte;

Procedure Gerak;
begin
Repeat
if (y=1) and (x<>1) then
begin
dec(x);
gotoxy(x,y);
write(Now^.Kar);
end
else if (x<>80) and (y=24) then
begin
inc(x);
gotoxy(x,y);
write(Now^.Kar);
end
else if x=80 then
begin
dec(y);
gotoxy(x,y);
write(Now^.Kar);
end
else if x=1 then
begin
inc(y);
gotoxy(x,y);
write(Now^.Kar);
end;
inc(i);
if (Now^.Next<>Nil) then Now:=Now^.Next;
until i>=jml;
end;

Procedure Tekan;
var
Ch : Char;
begin
Ch:=ReadKey;
if (Ch<>#27) and (Jml < Max) and (Ch<>'-') then
begin
Push(Ch);
inc(Jml);
end;
if (ch='-') then
if Head<>Nil then Pop else exit;
end;

begin
x:=2;
y:=1;
Repeat
i:=1;
Now:=Head;
Tx:=x;
Ty:=y;
if Head <> nil then Gerak;
Delay(500);
clrscr;
x:=Tx;
y:=Ty;
if (x<>80) and (y=1) then inc(x) else
if (x=1) and (y=24) then dec(x) else
if (x=80) and (y<>24) then inc(y) else
if (x=1) and (y<>1) then dec(y) else
if KeyPressed then Tekan;
Until Ch=#13;
end;

Begin
Head:=Nil;
Tail:=Nil;
Input;
clrscr;
Anim;
end.