Program soal1;
uses wincrt;
var aw,ak,f: integer ;
begin
write ('masukan waktu awal penggunaan komputer adalah jam : ');
read (aw);
write ('masukan waktu akhir penggunaan komputer adalah jam : ');
read (ak);
f:= ak-aw;
writeln('total waktu penggunaan komputer adalah : ' ,f , ' jam ' );
writeln('harga sewa komputer selama ',f, ' jam, adalah :', f*1500 );
end .
------------------------------------------------------------------------------------------
Program soal2;
uses wincrt;
var x1,x2,y1,y2, X,xx, Y,yy,XY, F: real ;
begin
write ('masukan x1 : ');
read (x1);
write ('masukan x2 : ');
read (x2);
write ('masukan y1 : ');
read (y1);
write ('masukan y2 : ');
read (y2);
X:=x2-x1;
writeln ('nilai x2-x1 =' , X :9:0);
xx:=sqr (X) ;
writeln ('nilai kuadrat dari pengurangan x =' , xx :9:0);
Y:=y2-y1;
writeln ('nilai y2-y1 =' , Y :9:0);
yy:=sqr (Y) ;
writeln ('nilai kuadrat dr pengurangan y =' , yy :9:0);
XY:=xx+yy;
writeln (' nilai kuadrat x + kuadrat y = ' , XY :9:0);
F:=sqrt(XY);
writeln('akar dari penjumlahan dua ttitik adalah : ' ,F :9:2 );
end.
-----------------------------------------------------------------------------------
Program soal3;
uses wincrt;
var p, l, K: real ;
begin
write ('masukan panjang : ');
read (p);
write ('masukan panjang : ');
read (l);
K:=(2*p)+(2*l);
writeln('keliling persegi panjang : ' , K :9:0);
end.
------------------------------------------------------------------------------------
Program LuasLingkaran;
uses wincrt;
var v, L, jari: real; r: integer ;
begin
v:=3.14;
write ('masukan jari jari : ');
read (r);
jari:= sqr(r);
L:= v*jari;
writeln('Luas Lingkaran : ' , L:9:2);
end.
---------------------------------------------------------------------------------------
Program jaraktengah;
uses wincrt;
begin
gotoxy (20,6); writeln ('tengah');
gotoxy (20,5); writeln ('ganti');
end.
14--09
{Praktikum|Membuat program untuk membuat pengimputan data belanja di swalayan "Joean"}
uses wincrt;
var
nmbrg,brc:string;
prc:integer;
begin
{Program Input Data}
write('Masukkan Nama Barang :');
readln(nmbrg);
write('Masukkan Barcode :');
readln(brc);
Write('Masukkan Harga :');
readln(prc);{Proses Menampilkan Data}
clrscr;{Membersihkan Layar}
gotoXY(33,3);writeln ('JOEAN-SWALAYAN');
gotoXY(32,5);writeln ('YOUR RECEIP TANKS');
gotoXY(20,7);writeln ('=======================================');
gotoXY(20,9);writeln ('Nama Barang :',nmbrg);
gotoXY(20,11);writeln('Nomor barcod :',brc);
gotoXY(20,13);writeln('Harga :',prc);
gotoXY(20,14);writeln('---------------------------------------');
gotoXY(20,15);writeln('Jumlah :',prc);
gotoXY(20,16);writeln('=======================================');
gotoXY(41,18);writeln ('PLEASS CALL AGAIN');
readln;
end.
{Praktikum|Membuat program untuk membuat pengimputan data belanja di swalayan "Joean"}
uses wincrt;
var
nmbrg,brc:string;
prc,jmb,ttl:integer;
begin
{Program Input Data}
write('Masukkan Nama Barang :');
readln(nmbrg);
write('Masukkan Barcode :');
readln(brc);
write('Jumlah Barang :');
readln(jmb);
Write('Masukkan Harga :');
ttl:=jmb*prc;
readln(prc);{Proses Menampilkan Data}
clrscr;{Membersihkan Layar}
gotoXY(33,3);writeln ('JOEAN-SWALAYAN');
gotoXY(32,5);writeln ('YOUR RECEIP TANKS');
gotoXY(20,7);writeln ('=======================================');
gotoXY(20,9);writeln ('Nama Barang ');
gotoXY(20,10);writeln(' :',nmbrg);
gotoXY(20,11);writeln('Nomor barcod ');
gotoXY(20,12);writeln(' :',brc);
gotoXY(20,13);writeln('Jumlah Barang ');
gotoXY(20,14);writeln(' :',jmb);
gotoXY(20,15);writeln('Harga :',prc);
gotoXY(20,16);writeln('---------------------------------------');
gotoXY(20,17);writeln('Jumlah Total :',ttl);
gotoXY(20,18);writeln('=======================================');
gotoXY(41,19);writeln ('PLEASS CALL AGAIN');
readln;
end.
]]]]]]]]]]]]]]]]]]]
uses wincrt;
var
a,b,c,d:integer;
hsl:string;
begin
write(' masukkan angka I :'); readln (a);
write ('masukkan angka II :'); readln (b);
c:= a*b;
d:= b+c;
if c> d then
hsl:= ' c lebih besar'
else if c<d then
hsl :=' d lebih besar'
else hsl:= 'c dan d sama';
write ('hasil perbandingan :',hsl);
end.
Tidak ada komentar:
Posting Komentar