Pascal (Tugas 3)
a. balok
uses crt;
var
p, t, l,v : real;
begin
clrscr;
writeln ('==========================================');
writeln ('===== Menghitung Volume Balok =====');
writeln ('==========================================');
write ('Panjang = '); readln (p);
write ('Lebar = '); readln (l);
write ('Tinggi = '); readln (t);
writeln ('==========================================');
writeln;
v := p*l*t;
writeln ('Volume Balok = ', v:5:2);
writeln;
readln;
end.
b.segitiga
program menghitung_luas_segitiga;
uses crt;
var
a,t:integer;
L:real;
begin
clrscr;
writeln('============================================');
writeln('====== Mari menghitung luas segitiga =====');
writeln('============================================');
writeln('masukkan nilai alas = ');
readln(a);
writeln('masukkan nilai tinggi = ');
readln(t);
L:=(a*t)/2;
writeln('luas segitiga adalah = ',L:6:2);
readln;
end.
c.Tabung
program luas_tabung;
uses crt;
var
r,t:integer;
phi,luas:real;
begin
clrscr;
writeln('=====================================');
writeln('=== mencari luas permukaan tabung ===');
writeln('========== bersama masruri ==========');
writeln('=====================================');
writeln('masukkan phi= ');
readln(phi);
writeln('masukkan jari-jari = ');
readln(r);
writeln('masukkan tinggi = ');
readln(t);
luas:=2*phi*r*t;
writeln('luasnya adalah = ',luas:0:2);
readln;
end.
uses crt;
var
p, t, l,v : real;
begin
clrscr;
writeln ('==========================================');
writeln ('===== Menghitung Volume Balok =====');
writeln ('==========================================');
write ('Panjang = '); readln (p);
write ('Lebar = '); readln (l);
write ('Tinggi = '); readln (t);
writeln ('==========================================');
writeln;
v := p*l*t;
writeln ('Volume Balok = ', v:5:2);
writeln;
readln;
end.
b.segitiga
program menghitung_luas_segitiga;
uses crt;
var
a,t:integer;
L:real;
begin
clrscr;
writeln('============================================');
writeln('====== Mari menghitung luas segitiga =====');
writeln('============================================');
writeln('masukkan nilai alas = ');
readln(a);
writeln('masukkan nilai tinggi = ');
readln(t);
L:=(a*t)/2;
writeln('luas segitiga adalah = ',L:6:2);
readln;
end.
c.Tabung
program luas_tabung;
uses crt;
var
r,t:integer;
phi,luas:real;
begin
clrscr;
writeln('=====================================');
writeln('=== mencari luas permukaan tabung ===');
writeln('========== bersama masruri ==========');
writeln('=====================================');
writeln('masukkan phi= ');
readln(phi);
writeln('masukkan jari-jari = ');
readln(r);
writeln('masukkan tinggi = ');
readln(t);
luas:=2*phi*r*t;
writeln('luasnya adalah = ',luas:0:2);
readln;
end.
0 komentar:
Posting Komentar
Seorang blogger yang baik,, ketika telah ngunjungi sebuah blog dan mendapatkan informasi pasti akan meninggalkan komentar yang baik dan membangun