Contoh Program Kelipatan 5 Repeat Until Pada Pascal

uses crt;
var a: integer;
begin
clrscr;
a:=5;
repeat
write(a,’ ‘);
a:=a+5;
until a>25;
readln;
end.

Administrasi mahasiswa

Program Administrasi_Mahasiswa;
uses crt;
const
pkkspp = 400000;
infospp = 600000;
elekspp = 500000;
bogaspp = 450000;
ptikspp = 500000;
pkkprak = 100000;
infoprak = 500000;
elekprak = 450000;
bogaprak = 600000;
ptikprak = 350000;
sehat : real = 10000;
var
nm,jur : string;
nojur : byte;
tahun :integer;
spp,prak : real;
tot : real;
begin
clrscr;
writeln(‘Administrasi Mahasiswa Fakultas Teknik dan Kejuruan’);
writeln(‘===================================================’);
write(‘Nama : ‘); readln(nm);
writeln(‘Keterangan Jurusan : ‘);
writeln(’1. PKK’);
writeln(’2. D3 Informatika’);
writeln(’3. D3 Elektro’);
writeln(’4. D3 Boga Perhotelan’);
writeln(’5. PTIK’);
write(‘Jurusan (tulis no saja) : ‘); readln(nojur);
write(‘Tahun Masuk : ‘); readln(tahun);
if tahun<2004 then
begin
if nojur = 1 then
begin
spp := pkkspp;
jur := ‘PKK’
end
else if nojur = 2 then
begin
spp :=infospp;
jur := ‘D3 Informatika’;
end
else if nojur = 3 then
begin
spp :=elekspp;
jur := ‘D3 Elektro’
end
else if nojur = 4 then
begin
spp :=bogaspp;
jur := ‘D3 Boga Perhotelan’;
end
else if nojur= 5 then
begin
spp :=ptikspp;
jur := ‘PTIK’
end
else
writeln(‘Jurusan salah, tolong ulangi !!’);

end
else
begin
if nojur = 1 then
begin
spp := pkkspp;
prak:= pkkprak;
jur := ‘PKK’
end
else if nojur= 2 then
begin
spp :=infospp;
prak:= infoprak;
jur := ‘D3 Informatika’;
end
else if nojur = 3 then
begin
spp :=elekspp;
prak:=elekprak;
jur := ‘D3 Elektro’;
end
else if nojur = 4 then
begin
spp :=bogaspp;
prak:=bogaprak;
jur := ‘D3 Boga Perhotelan’;
end
else if nojur= 5 then
begin
spp :=ptikspp;
prak:=ptikprak;
jur := ‘PTIK’;
end
else
writeln(‘Jurusan salah, tolong ulangi !!’);
end;
tot := spp+prak+sehat;
writeln(‘Nama : ‘,nm);
writeln(‘Jurusan : ‘,jur);
writeln(‘Tahun Masuk : ‘,tahun);
writeln(‘Uang SPP : Rp. ‘,spp:7:2);
writeln(‘Uang Praktikum : Rp. ‘,prak:7:2);
writeln(‘Uang Kesehatan : Rp. ‘,sehat:7:2);
writeln(‘———————————’);
writeln(‘Total Pembayaran : Rp. ‘,tot:7:2);
writeln(‘=================================================’);
readln;
end.

Regula Falsi

program regula_falsi;
uses crt;
label ulang;
var
x1,x2,x3,y1,y2,y3 : real;
i : integer;
Ab :char;
data1 : real;
begin
ulang:
clrscr;
writeln(‘Tentukan nilai akar dari persamaan f(x)=x^3+x^2-3x-3=0 dengan Regula Falsi’);
write(‘Masukan nilai x1 = ‘);readln(x1);
y1 := x1 * x1 * x1 + x1 * x1 – 3 * x1 – 3;
writeln(‘ Nilai f(x1)= ‘,y1:0:4);
repeat
begin
write( ‘Masukan nilai x2 = ‘ ); readln(x2);
y2 := x2 * x2 * x2 + x2 * x2 – 3 * x2 – 3;
write(‘ Nilai f(x2)= ‘,y2:0:4);
end;
if (y1*y2)<0 then
Writeln(‘ Syarat Nilai Ok’)
else
Writeln(‘ Nilai X2 Belum Sesuai’);
until ( y1 * y2 ) <0;
writeln;
writeln(‘Penyelesaian persamaan karekteristik dengan metoda regula falsi’);
writeln(‘———————————————————————-’);
writeln(‘ n x f(x) error ‘);
writeln(‘———————————————————————-’);
repeat
begin
i:= i + 1; x3 := ( x2-( y2 / ( y2 – y1))*(x2-x1));
y3 := x3 * x3 * x3 + x3 * x3 – 3 * x3 – 3;
if i<10 then
writeln(‘ ‘,i,’ : ‘,x3,’ : ‘,y3,’ : ‘,abs(y3),’ : ‘)
else
writeln(i,’ : ‘,x3,’ : ‘,y3,’ : ‘,abs(y3),’ : ‘);
if ( y1 * y3 ) <0 then
begin
x2 := x3 ; y2 := y3 ;
end
else
begin
x1 := x3 ; y1 := y3;
end;
end;
until abs( y3 ) < 1E-08;
writeln(‘———————————————————————-’);
writeln(‘Akar persamaannya= ‘,x3);
writeln(‘Errornya=’ ,abs( y3 ));
writeln(‘———————————————————————-’);
writeln(‘Apakah anda ingin mengulangi (y/t): ‘);
readln(ab);
if (ab=’y') or (ab=’Y') then
goto ulang;
end.

Menghitung nilai Sin dengan sudut radian

program sin(x);
uses crt;
const pi = 3.14;
var
x,rad,p1,tot : real;
n,i,faktor,p2,j : integer;
tanda : byte;

begin
clrscr;
writeln(‘ Menentukan nilai sin(x)’);
write(‘Nilai x = ‘); readln(x);
write(‘Masukkan pangkat = ‘); readln(n);
rad := pi*x/180;
i := 1;
tanda := 1;
while i <= n do
begin
p1 := exp(i*ln(rad));
faktor := 1;
for j := 1 to i do
faktor := faktor *j;
p2 := faktor;
tot := tot + (tanda*p1/p2);
tanda := (-1)*tanda;
i := i+2;
end;
writeln(‘Sin(‘,x:5:2,’) = ‘,tot:5:2);
readln;
end.

Menghitung Luas dan keliling lingkaran

Program Luas_dan_Keliling_Lingkaran;
uses crt;
const pi = 3.14;
var
r,K,L : real;
begin
clrscr;
writeln(‘=============================’);
writeln(‘Menghitung Luas dan Keliling’);
writeln(‘—————————-’);
write(‘Jari – jari = ‘); readln(r);
K := pi*2*r;
L := pi*r*r;
writeln(‘Keliling Lingkaran = ‘,K:5:2);
writeln(‘Luas Lingkaran = ‘,L:5:2);
writeln(‘=============================’);
readln;
end.

Program Cek kelulusan dalam bahasa Pascal

program cek_kelulusan_siswa;
uses crt;
var
nama : string[25];
kelas : string[5];
no_absen : string[3];
n_tugas : byte;
n_u_hari : byte;
n_u_umum : byte;
rerata : real;
lulus : boolean;
predikat : string[20];
begin
clrscr;
writeln(‘====================================================’);
writeln(‘| Program Mengecek Kelulusan Siswa |’);
writeln(‘====================================================’);
writeln;
writeln(‘Input Data Siswa’);
writeln(‘—————-’);
write(‘Nama : ‘); readln(nama);
write(‘Kelas : ‘); readln(kelas);
write(‘No Absen : ‘); readln(no_absen);
write(‘Nilai Tugas : ‘); readln(n_tugas);
write(‘Nilai Ulangan Harian : ‘); readln(n_u_hari);
write(‘Nilai Ulangan Umum : ‘); readln(n_u_umum);
rerata:=(n_tugas + 2 * n_u_hari + 3 * n_u_umum)/6;
if rerata >=70 then lulus:=true
else lulus:= false;
clrscr;
writeln(‘====================================================’);
writeln(‘| Program Mengecek Kelulusan Siswa |’);
writeln(‘====================================================’);
writeln;
writeln(‘ Siswa dengan’);
writeln(‘—————-’);
writeln(‘Nama : ‘,nama);
writeln(‘Kelas : ‘,kelas);
writeln(‘No Absen : ‘,no_absen);
writeln(‘Nilai Tugas : ‘,n_tugas);
writeln(‘Nilai Ulangan Harian : ‘,n_u_hari);
writeln(‘Nilai Ulangan Umum : ‘,n_u_umum);
writeln(‘Rata – rata : ‘,rerata:0:2);
if lulus then
begin
if rerata < 80 then predikat:=’memuaskan’
else if rerata <90 then predikat:=’sangat memuaskan’
else predikat:=’dengan pujian’;
writeln(‘Dinyatakan Lulus dengan ‘,predikat);
end
else
writeln(‘Dinyatakan Tidak Lulus’);
readln;
end.

Penggunaan Record pada Turbo Pascal

uses crt;
type nilai = record
hari,tugas,umum,na : real;
end;
type mapel = record
kimia,basindo : nilai;
end;
type siswa = record
nama : string[25];
nis : string[3];
mp : mapel;
end;
var
i,n,a : byte;
student : array [1..100] of siswa;
stop : boolean;
b : string[4];
begin
stop := false;
Repeat
clrscr;
write(‘Banyak siswa : ‘); readln(n);
clrscr;
writeln(‘=======================================================================’);
writeln(‘NIS Nama Siswa Mata Pelajaran N.Hr N.Tgs N.Umum N.Akhir’);
writeln(‘———————————————————————–’);
a:=4;
for i := 1 to n do
begin
with student[i] do
begin
readln(nis);
gotoxy(6,a);
readln(nama);
with mp do
begin
gotoxy(26,a);
writeln(‘Bahasa Indonesia’);
with basindo do
begin
gotoxy(44,a);
readln(hari);
gotoxy(50,a);
readln(tugas);
gotoxy(57,a);
readln(umum);
na:=(2*hari+tugas+3*umum)/6;
gotoxy(65,a);
writeln(na:3:2);
end;

11 responses »

  1. putri ayu berliana mengatakan:

    makasih atas infonya…
    bagus banget nih hehe😀
    tugas tik ku selesai dehhh

  2. Lamonica Ayuso mengatakan:

    I simply want to mention I’m newbie to weblog and definitely enjoyed you’re web page. More than likely I’m planning to bookmark your blog . You really have good posts. Regards for revealing your blog site.

  3. ezi mengatakan:

    keren bang, thx udah share ilmunya..

  4. white whall mengatakan:

    The Silent Shard

    This could possibly be fairly handy for a few within your work I intend to you should not only with my blogging site but

  5. Rendy Juniansyah mengatakan:

    Thanks Bgt Infonya Ya Gan ini yang Lagi Saya Cari Cari ..
    Sekali Lagi Thanks ..

  6. takamura nara mengatakan:

    Thank, banget gan atas informasinya jadi, nambah pengalaman nihh…!!

  7. Zhayanoer Al Ghifari mengatakan:

    kalo membuat program bintang gmna ya master ?

  8. rosid mengatakan:

    selamat pagi mas / mbak kalau untuk membuat pemrograman apakah bisa dibantu untuk dikasih master programnya ya

  9. hikmah mengatakan:

    kalau membuat program kelulusan gimna scrip’nya?

  10. matuleshi mengatakan:

    kirimkan contoh program untuk buat game donk gan….

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s