Nim : 09 310 732
Kelas : A_PTI
Semester : II
ini scip tuk turbo pascal 7.1
1. Program Mencari IP
uses crt;
var
TM,MAN,TT,MID,NS,Nas:real;
n,i :integer;
Nama,Nim : string;
Masuk_Lagi : Char;
begin
Masuk_Lagi :='Y';
while Masuk_Lagi='Y' do
begin
clrscr;
writeln(' ******* Program By: Paskal Hutapea *******');
writeln;
write('Masukkan jumlah data : ');
readln(n);
i:=0;
Writeln;
while i
uses crt;
var
i1,i2,i3,j,x1,x2,x3,y,z:integer;
Masuk_Lagi : Char;
Begin
Masuk_Lagi :='Y';
While Masuk_Lagi='Y' do
begin
clrscr;
writeln (' ========= Program By : Paskal Hutapea =========');
writeln;
writeln('Untuk memulai Masukkan tanggal sekarang : ');
writeln('------------------------------------------');
write('Tanggal : ');
readln(x3);
write('Bulan : ');
readln(x2);
write('Tahun : ');
readln(x1);
writeln;
writeln('Masukkan tanggal Lagir anda : ');
writeln('-----------------------------');
write('Tanggal : ');
readln(i3);
j:=x3-i3;
write('Bulan : ');
readln(i2);
y:=x2-i2;
if i2 > x2 then
begin
y:=12-i2-x2;
end;
write('Tahun : ');
readln(i1);
z:=x1-i1;
if i2 > x2 then
begin
z:= z-1;
end;
writeln;
write('=====TEKAN ENTER TO PROSES=====');
write;
readln;
writeln('---------------------------------------------------------');
writeln('Umur anda adalah : ',z,' Tahun ',y,' Bulan ',j,' Hari ');
writeln('---------------------------------------------------------');
writeln;
write('Masuk_Lagi (Y/T) ? : ');
readln (Masuk_Lagi);
end;
readkey ;
end.
3. Program Ramalan Sederhana
uses crt;
Var
nama,enter: string[50];
lagi:char;
begin
lagi:='y';
while lagi='y'do
begin
Clrscr;
writeln;
write(' ***** PROGRAM BY : PASKAL HUTAPEA ***** ');
writeln;
writeln;
Write('Nama anda :');
readln(Nama);
writeln;
Write('Nama Pasangan anda :');
readln(Nama);
writeln;
write('Tekan ENTER untuk proses....');
readln(enter);
writeln;
writeln;
if length(nama)>8 then
write('*** anda cocok dengan proporsi 80% ***')
else if length(nama)=7 then
write('*** anda cocok dengan proporsi 60% ***')
else if length(nama)>=6 then
write('*** anda & Pasangan anda kurang cocok Proporsi hubungan kira kira 50% !!! ***')
else if length(nama)>=5 then
write('*** hubngan ini di bawah cocok !proporsi hubungan anda hanya 48% ***')
else write('*** anda tidak cocok sama sekali!!! sudahhhh Putus aja !!! ***');
writeln;
writeln;
Write('Masukkan lagi (y/t) ? : ');
readln(lagi);
end;
readkey;
end.
4. Piramid
{Paskal Hutapea
09310732
FATEK-A}
uses crt;
var i,j,n,lok,k,a,b: byte;
begin
repeat
textbackground(red);
textcolor(white);
clrscr;
write('Tinggi piramida[3..12]: ');readln(n);
until n in[3..12];
{bagian puncak atas}
lok:=39;
gotoxy(lok,1); write('*');
{Kiri dan kanan atas}
for i:= 1 to n-1 do
begin
lok:=40-i;
for j:= 1 to 1 do
begin
gotoxy(lok-1,i+1); write('*');
end;
lok:=40+i;
for k:= 1 to 1 do
begin
gotoxy(lok-1,i+1);
write('*');
end;
end;
{bagian tengah atas}
for i:= 1 to n-2 do
begin
lok:=40-i;
for j:= 1 to i do
begin
gotoxy(lok,i+2);
write(' ');
lok:=lok+2;
end;
end;
a:=i;
{bagan tengah}
for i:= 1 to n+1 do
begin
gotoxy(lok+1,a+3); {utk mengubah lebar aturlah lok-nya dan n}
for j:=1 to 1 do write('*');
lok:=lok-2;
end;
b:=i;
{bagian bawah}
for i:= n-2 downto 1 do
begin
lok:=38+i;
for j:= 1 to i do
begin
gotoxy(lok,a+4); {nilai a bisa ditambah}
write(' ');
lok:=lok-2;
end;
inc(a);
end;
{kiri dan kanan bawah}
for i:= n-1 downto 1 do
begin
lok:=38-i;
for j:= 1 to 1 do
begin
gotoxy(lok+1,b+1); write('*');
end;
lok:=38+i;
for k:= 1 to 1 do
begin
gotoxy(lok+1,b+1); write('*');
end;
inc(b);
end;
{puncak bawah}
lok:=39;
gotoxy(lok,b+1); write('*');
readkey;
end.
Bagi Teman2 ygb blon Celar boleh coba scrip di atas... to tuk memperbaiki Catatan teman teman....
tuk tugas2 berikut saya akan Post kembali.
Salam TURBO
Tidak ada komentar:
Posting Komentar
Thk's 4 u'r coment.