1. Luas Balok
program luas_balok;
uses crt;
var
luas,p,l,t : integer;
begin
clrscr;
writeln('---------------------------------------');
writeln('-----Program Menghitung Luas Balok-----');
writeln('---------------------------------------');
writeln;
write('Masukan Nilai panjang = '); readln(p);
write('Masukan Nilai lebar = '); readln(l);
write('Masukan Nilai Tinggi = '); readln(t);
luas:=2*(p*l)+(p*t)+(l*t);
writeln('Luas Balok = ',luas);
writeln;
write('Tugas 3, Misbahul Munir, Kelas i');
readln;
end.
2. Luas Segitiga
program luas_segitiga;
uses crt;
var
a,t : integer;
luas : real;
begin
clrscr;
writeln('------------------------------------------');
writeln('-----Program Menghitung Luas Segitiga-----');
writeln('------------------------------------------');
writeln;
write('Masukan Nilai Alas = '); readln(a);
write('Masukan Nilai Tinggi = '); readln(t);
luas:=0.5*a*t;
writeln('Luas Segitiga = ',round(luas));
writeln;
write('Tugas 3, Misbahul Munir, Kelas i');
readln;
end.
3. Luas Tabung
program luas_tabung;
uses crt;
var
p,r,t : integer;
luas: real;
begin
clrscr;
writeln('----------------------------------------');
writeln('-----Program Menghitung Luas Tabung-----');
writeln('----------------------------------------');
writeln;
write('Masukan Nilai phi = '); readln(p);
write('Masukan Nilai jari-jari = '); readln(r);
write('Masukan Nilai Tinggi = '); readln(t);
luas:=2*p*r*(r+t);
writeln('Luas Tabung = ',luas:0:2);
writeln;
write('Tugas 3, Misbahul Munir, Kelas i');
readln;
end.
0 komentar:
Posting Komentar