MENENTUKAN_BILANGAN_PHYTAGORAS


PROGRAM MENENTUKAN_BILANGAN_PHYTAGORAS;

Uses Crt;

Var
a,b,c:Real;

Begin
Clrscr;
Writeln (' MENENTUKAN BILANGAN PHYTAGORAS ');
Writeln (' OLEH : Dian ALiza Pratidina_070804_IV B ');
Writeln;

Write ('Masukan a: ');
Readln (a);
writeln;
Write ('Masukan b: ');
Readln (b);

c:= sqrt ((a*a)+(b*b));
Writeln;

Writeln ('Sehingga Nilai c adalah : ',c:2:2);
Writeln;

If a>0 Then
begin
Writeln;
Writeln ('a MERUPAKAN BILANGAN ASLI');
end else if a<0 Then
begin
Writeln ('a BUKAN MERUPAKAN BILANGAN ASLI');
end;
Writeln;
if b>0 Then
begin
Writeln ('b MERUPAKAN BILANGAN ASLI');
end else if b<0 Then
begin
Writeln ('b BUKAN MERUPAKAN BILANGAN ASLI');
end;
Writeln;
if c>0 Then
begin
Writeln ('c MERUPAKAN BILANGAN ASLI');
end else if c<0 Then
begin
Writeln ('c BUKAN MERUPAKAN BILANGAN ASLI');
end;

Writeln;
WriteLn ('Terima Kasih Sudah Menggunakan Program ini');

READLN;

END.


Read Users' Comments ( 0 )

mencari Luas Segitiga



Program menghitung_luas_segitiga;

uses crt;

var
a,b,c:integer;
s,luas:real;

begin
clrscr;
writeln (' INI ADALAH PROGRAM MENGHITUNG LUAS SEGITIGA ');
writeln (' Oleh Dian Aliza Pratidina 070804 IV B ');
writeln;
write (' masukkan a : '); readln (a);
write (' masukkan b : '); readln (b);
write (' masukkan c : '); readln (c);

s:=(a+b+c)/2;
writeln;
writeln (' didapat nilai s adalah= ',s:2:2);

luas:=sqrt(s*(s-a)*(s-b)*(s-c));
writeln;
writeln (' sehingga luas segitiga adalah= ' , luas:2:2);
writeln ;
writeln (' terima kasih sudah menggunakan program ini');
readln;
end.


Read Users' Comments ( 0 )


PROGRAM Menentukan_Koordinat_Pusat_dan_Jarijari_Lingkaran_dari_3_Buah_Titik;

Uses Crt;

Var x1,y1,x2,y2,x3,y3:Real;
k2,k3,h2,h3,Xo,Yo,r:Real;

Begin
Clrscr;

Write ('MENENTUKAN KOORDINAT PUSAT&JARI-JARI LINGKARAN DARI TIGA BUAH TITIK');
Write (' OLEH DIAN ALIZA P. 070804 (4B) ');
Writeln;
writeln;

Write ('Masukan x1 : ');Readln (x1);
Write ('Masukan y1 : ');Readln (y1);
Write ('Masukan x2 : ');Readln (x2);
Write ('Masukan y2 : ');Readln (y2);
Write ('Masukan x3 : ');Readln (x3);
Write ('Masukan y3 : ');Readln (y3);
Writeln;

k2:=(-1*((x2-x1)/(y2-y1)));
k3:=(-1*((x3-x1)/(y3-y1)));
Writeln ('NILAI k2 ADALAH : ',k2:2:2);
Writeln ('NILAI k3 ADALAH : ',k3:2:2);
Write;

h2:=((y1+y2)/(2))+(((x2*x2)-(x1*x1))/((2)*(y2-y1)));
h3:=((y1+y3)/(2))+(((x3*x3)-(x1*x1))/((2)*(y3-y1)));
Writeln ('NILAI h2 ADALAH : ',h2:2:2);
Writeln ('NILAI h3 ADALAH : ',h3:2:2);
Write;

Xo:=((h3-h2)/(k2-k3));
Yo:=((k3*h3-k2*h2)/(k2-k3));

r:= sqrt ((x1-Xo)*(x1-Xo)+(y1-Yo)*(y1-Yo));
Writeln ('NILAI Xo ADALAH : ',Xo:2:2);
Writeln ('NILAI Yo ADALAH : ',Yo:2:2);
Write;

Writeln ('NILAI r ADALAH : ', r:2:2);
Writeln;

Writeln ('Terima Kasih Sudah Menggunakan Program Ini');


READLN;
END.


Read Users' Comments ( 0 )

bilangan prima


Program Mencetak_Bilangan_Prima;
Uses crt;
Const batas=500;
var
prima : array [1..batas] of boolean; { bilangan prima }
batas_geser, { batas pergeseran }
i,j : integer; { counter / cacah }

Begin
clrscr;
For i:=1 to Batas do
prima [i] :=true;
batas_geser:=trunc(sqrt(batas));
i:=2;
{ proses penggeseran }
While i<=batas_geser do
Begin
If prima [i] then
Begin
j:=i+i;
While j<=batas do
Begin
prima [j] :=false;
j:=j+i;
End;
End;
i:=i+1;
End;

{ cetak hasil proses....}

Writeln (' Bilangan Prima antara 1 s/d 500 ', Batas);
writeln (' OLeh dian aliza pratidina 070804 Math 4_B ');
Writeln ('----------------------------------------------------');
Writeln;
j:=1;
For i:=2 to Batas do
Begin
If prima[i] then
Begin
If J > 8 Then
Begin
j:=1;
Writeln;
End
Else
Begin
write(' ',i:3);
j:=j+1;
End;
End;
End;
writeln;writeln ('Selesai...');
end.


Read Users' Comments ( 0 )




Uses crt;

Var
jumlah:real;
x,n:integer;


Begin
Clrscr;

Writeln ('__________________________Selamat Datang di________________________');
Writeln ('PROGRAM MENENTUKAN BANYAK DAN JUMLAH BILANGAN DARI BILANGAN PECAHAN');
Writeln (' Oleh :Dian Aliza Pratidina ');
writeln (' 070804 ');
Writeln;

n:=25;
jumlah:=0;

for x:=1 to n-1 do
begin
write ('1/',x*x,' , ');
jumlah:=jumlah+1/(x*x);
end;

write ('1/',n*n);
jumlah:=jumlah+1/(n*n);
writeln;

writeln;
writeln ('Banyaknya:',n);
writeln ('Jumlah:',jumlah:2:2);
writeln;
writeln ('_______________________________terima kasih_________________________');

readln;

End.


Read Users' Comments ( 0 )

tugas prosedur menu matriks


program Menu_pilihan_MATRIKS;

begin

uses crt;

var
Mat_A,Mat_B,Mat_C:array[1..10,1..10] of integer;
ordo_x,ordo_y:integer;
x,y,z,koor_brs:integer;
L,K,s,a,t,p:real;
pilih:byte;

procedure input_penjumlahan_matriks;
begin
writeln ('ini adalah program menghitung penjumlahan matriks');
writeln('Tentukan Ordo Matriks[x,y]');
readln (ordo_x,ordo_y);
writeln('input Matriks (A):');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_A[x,y]);
end;
end;
writeln('input Matriks (B): ');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_B[x,y]);
end;
end;
end;

procedure input_pengurangan_matriks;
begin
writeln ('ini adalah program menghitung pengurangan matriks');
writeln('Tentukan Ordo Matriks[x,y]');
readln (ordo_x,ordo_y);
writeln('input Matriks (A): ');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_A[x,y]);
end;
end;
writeln('input Matriks (B): ');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_B[x,y]);
end;
end;
end;

procedure input_perkalian_matriks;
begin
writeln('Tentukan Ordo Matriks');
readln (ordo_x,ordo_y);
writeln('input Matriks (A): ');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_A[x,y]);
end;
end;
writeln('input Matriks (B): ');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_B[x,y]);
end;
end;
end;

procedure input_transpost_matriks;
begin
writeln('Tentukan Ordo Matriks');
readln (ordo_x,ordo_y);
writeln('input Matriks (A): ');
for y:=1 to ordo_y do
begin
koor_brs := wherey;
for x:=1 to ordo_x do
begin
gotoxy (x*5,koor_brs);
read (Mat_A[x,y]);
end;
end;
end;

procedure rumus_penjumlahan_matriks;
begin
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
Mat_C[x,y]:= Mat_A[x,y] + Mat_B[x,y];
end;
end;
end;

procedure rumus_pengurangan_matriks;
begin
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
Mat_C[x,y]:= Mat_A[x,y] - Mat_B[x,y];
end;
end;
end;

procedure rumus_perkalian_matriks;
begin
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
Mat_C[x,y]:=0;
for z:=1 to ordo_x do
begin
Mat_C[x,y]:=Mat_C[x,y] + Mat_A[z,y]*Mat_B[x,z];
end;
end;
end;
end;

procedure rumus_transpost_matriks;
begin
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
Mat_C[x,y]:= Mat_A[y,x];
end;
end;
end;

procedure output_penjumlahan_matriks;
begin
writeln;
writeln('maka penjumlahan matriks A dan B = ');
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
write(Mat_C[x,y]:5);
end;
write;readln;
end;
end;

procedure output_pengurangan_matriks;
begin
writeln;
writeln('maka pengurangan matriks A dan B = ');
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
write(Mat_C[x,y]:5);
end;
write;readln;
end;
end;

procedure output_perkalian_matriks;
begin
writeln;
writeln('maka perkalian matriks A dan B = ');
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
Mat_C[x,y]:=0;
for z:=1 to ordo_x do
begin
Mat_C[x,y]:=Mat_C[x,y]+(Mat_A[z,y]*Mat_B[x,z]);
end;
write(Mat_C[x,y]:5);
end;
writeln;
readln;
end;
end;

procedure output_transpost_matriks;
begin
writeln;
writeln ('hasil transpost matrik adalah : ');
for y:=1 to ordo_y do
begin
for x:=1 to ordo_x do
begin
Mat_C[x,y]:=Mat_A[y,x];
write(Mat_C[x,y]:5);
end;
writeln;readln;
end;
end;

procedure Penjumlahan_matriks;
begin
writeln;
input_penjumlahan_matriks; readln;
rumus_penjumlahan_matriks; read;
output_penjumlahan_matriks; read;
writeln('tekan ENTER untuk pilih program lain'); readln;
end;
procedure PIL1;
begin
writeln;
writeln;
input_pengurangan_matriks; readln;
rumus_pengurangan_matriks; read;
output_pengurangan_matriks; read;
writeln('tekan ENTER untuk pilih program lain'); readln;
end;
procedure PIL2;
begin
writeln;
input_perkalian_matriks; readln;
rumus_perkalian_matriks; read;
output_perkalian_matriks; readln;
writeln('tekan ENTER untuk pilih program lain'); readln;
end;
procedure PIL3;
begin
writeln;
input_transpost_matriks; readln;
rumus_transpost_matriks; read;
output_transpost_matriks;readln;
writeln('tekan ENTER untuk pilih program lain'); readln;
end;

begin
while true do
begin
textcolor(yellow);
clrscr;
write('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');writeln;
write('~~~~~SELAMAT DATANG DI PROGRAM MENU MATRIKS~~~~');writeln;
write('~~~~~~~~~~~~~dian aliza pratidina~~~~~~~~~~~~~~');writeln;
write('************** NIM : 070804 *****************');writeln;
write('***********************************************');writeln;
write('=================== MENU ==================');writeln;
write('= 1. penjumlahan matriks =');writeln;
write('= 2. pengurangan matriks =');writeln;
write('= 3. perkalian matriks =');writeln;
write('= 4. transpost matriks =');writeln;
write('= 5. exit =');writeln;
write('===============================================');writeln;
pilih:=0;
while(pilih<1)>5) do
begin
write('Silahkan pilih menu : ');read(pilih);
if (pilih<1)>5) then
end;
case pilih of
1: penjumlahan_matriks;
2: PIL1;
3: PIL2;
4: PIL3;
5: exit;
end;
end;
END.


Read Users' Comments ( 0 )

Program Pascal Pilihan Menu


Program Mencari_Luas_dan_Keliling_Bangun_Datar;
Uses crt;
Var a,b,c,t,r,pjg,lbr,s: integer;
L,K: real;

Procedure menu;

Begin
writeln ('1. Segitiga');
writeln ('2. Lingkaran');
writeln ('3. Pesegi Panjang');
writeln ('4. Persegi');
End;

Procedure Segitiga;

Begin
writeln ('Menghitung Luas dan Keliling Segitiga');
write ('Panjang a= '); readln (a);
write ('Panjang b= '); readln (b);
write ('Panjang c= '); readln (c);
write ('Tinggi Segitiga= '); readln (t);
L:= (a*t)/2;
K:= (a+b+c);
write ('Luas Segitiga = ', L:2:2); readln;
write ('Keliling Segitiga = ', K:2:2); readln;
End;

Procedure Lingkaran;

const phi=3.14;
Begin
writeln ('Menghitung Luas dan Keliling Lingkaran');
write ('Panjang r= '); readln (r);
L:= phi*r*r;
K:= 2*phi*r;
write ('Luas Lingkaran adalah ', L:2:2); readln;
write ('Keliling Lingkaran adalah ', K:2:2); readln;

end;

Procedure Persegi_Panjang;

Begin
writeln ('Menghitung Luas dan Keliling Persegi_Panjang');
write ('p= '); readln (pjg);
write ('l= '); readln (lbr);
L:= pjg*lbr;
K:= (2*pjg)+(2*lbr);
write ('Luas Persegi_Panjang adalah = ',L:2:2);readln;
write ('Keliling Persegi_Panjang adalah = ',K:2:2);readln;
End;

Procedure Persegi;

Begin
writeln ('Menghitung Luas dan Keliling Persegi');
write ('panjang sisi= '); readln (s);
L:= s*s;
K:= 4*s;
write ('Luas Persegi adalah ',L:2:2); readln;
write ('Keliling Persegi adalah ',K:2:2); readln;
End;

Var pil:char;

Begin
Clrscr;
writeln ('program menghitung luas dan keliling bangun datar');
writeln ('oleh : dian aliza_070804');
writeln ('matematika_IV B');
writeln ('Berikut pilihan menu yang dapat Anda pilih : ');
Menu;
write ('Menu yang Anda pilih adalah '); readln (pil);
Case pil of
'1': begin segitiga; end;
'2': begin lingkaran; end;
'3': begin persegi_panjang; end;
'4': begin persegi; end;
End; readln;

End.


Read Users' Comments ( 0 )