program turbo pascal “RUMUS-RUMUS FISIKA”

contoh program pascal :

uses wincrt;
const
pi = 3.14 ;
var
panjang,lebar, tinggi,sisi, jarijari,
luasbalok, luaskubus,volumebalok,volumekubus,
volumekerucut : real ;

massa, mol, molar, ar,kalor,volume,T1,T2,molal,kalorjenis : real ;
hambatan, arus,energilistrik, dayalistrik,
tekanan, tegangan, kecepatan,
energi, luas, percepatan, gaya, momentum,
daya, jarak,waktu : real;

pilihanrumus, pilihan : char;
coba, nama, start :string[15];
nim : integer;
label
ulang, akhir ;

begin
writeln(‘ * registrasi * ‘);
writeln(‘====================’);
write(‘nama : ‘);
readln(nama);
write(‘nim : ‘);
readln(nim);
write(‘press “enter” to start !’);
readln(start);

ulang :
clrscr;

writeln(‘__________________________’);
writeln(‘ Koleksi Kumpulan Rumus ‘);
writeln(‘ created by Ahmad Shidiqi’);
writeln(‘ ======================= ‘);
writeln(‘ Daftar Rumus ‘);
writeln(‘ 1) fisika ‘);
writeln(‘ 2) matematika ‘);
writeln(‘ 3) kimia ‘);
writeln(‘ which one do you want ? ‘);
writeln(‘ masukan pilihan : ‘);
writeln(‘__________________________’);
readln(pilihanrumus);
case pilihanrumus of

‘1’ :
begin
clrscr;
writeln(‘_______________________________’);
writeln(‘* rumus – rumus fisika *’);
writeln(‘* ==================== *’);
writeln(‘* pilihan rumus : *’);
writeln(‘* a) kecepatan *’);
writeln(‘* b) percepatan *’);
writeln(‘* c) gaya *’);
writeln(‘* d) energi listrik *’);
writeln(‘* e) daya listrik *’);
writeln(‘* f) tekanan *’);
writeln(‘* g) hambatan *’);
writeln(‘* mau yang mana ? *’);
writeln(‘* silahkan masukan pilihan !! *’);
writeln(‘_______________________________’);

readln(pilihanrumus);

case pilihanrumus of

‘a':
begin

write(‘masukan jarak = ‘);
readln(jarak);
write(‘masukan waktu = ‘);
readln(waktu);
kecepatan:=jarak/waktu;
writeln(‘kecepatan = ‘,kecepatan:4:2, ‘ m/s’ );
writeln(‘benar bukan ? ^_^’);
readln;
end;

‘b’ :
begin

write(‘masukan kecepatan = ‘);
readln(kecepatan);
write(‘masukan waktu = ‘);
readln(waktu);
percepatan:=kecepatan/waktu;
writeln(‘percepatan = ‘,percepatan:4:2,’ m/s2′);
writeln(‘benar bukan ? ^_^’);
readln;
end;

‘c’ :
begin

write(‘masukan massa = ‘);
readln(massa);
write(‘masukan percepatan = ‘);
readln(percepatan);
gaya:=massa*percepatan;
writeln(‘gaya = ‘,gaya:4:2,’ N’);
writeln(‘benar bukan ? ^_^’);
readln;
end;

‘d’ :
begin

write(‘masukan tegangan = ‘);
readln(tegangan);
write(‘masukan arus = ‘);
readln(arus);
write(‘masukan waktu = ‘);
readln(waktu);
energilistrik:=tegangan*arus*waktu;
writeln(‘energi listrik = ‘,energilistrik:4:2,’ joule’);
writeln(‘benar bukan ? ^_^’);
readln;
end;

‘e’ :
begin

write(‘masukan tegangan = ‘);
readln(tegangan);
write(‘masukan arus = ‘);
readln(arus);
dayalistrik:=tegangan*arus;
writeln(‘daya listrik = ‘,dayalistrik:4:2,’ watt’);
writeln(‘benar bukan ? ^_^’);
readln;
end;

‘f’ :
begin

write(‘masukan gaya = ‘);
readln(gaya);
write(‘masukan luas permukaan = ‘);
readln(luas);
tekanan:=gaya*luas;
writeln(‘tekanan = ‘,tekanan:4:2,’ pascal’);
writeln(‘benar bukan ? ^_^’);
readln;

end;

‘g':
begin

write(‘masukan arus = ‘);
readln(arus);
write(‘masukan tegangan = ‘);
readln(tegangan);
hambatan:=tegangan/arus;
writeln(‘hambatan = ‘,hambatan:4:2,’ ohm’);
writeln(‘benar bukan ? ^_^’);
readln;

end;

else
writeln(‘sorry..incorrect action !!!!’);
writeln(‘——————————————————–‘);

end;
writeln(‘ingin coba lagi(ya/tidak) ? :’);
readln(coba);
if coba =’ya’ then goto ulang
else
goto akhir;
end;

‘2’ :
begin
clrscr;
writeln(‘______________________________’);
writeln(‘* rumus – rumus matematika *’);

writeln(‘* ========================== *’);
writeln(‘* a) luas permukaan kubus *’);
writeln(‘* b) luas permukaan balok *’);
writeln(‘* c) volume balok *’);
writeln(‘* d) volume kubus *’);
writeln(‘* e) volume kerucut *’);
writeln(‘* mau pilih yang mana ??? *’);
writeln(‘* silahkan masukan pilihan : ‘);
writeln(‘______________________________’);
readln(pilihanrumus);
case pilihanrumus of
‘a’ :
begin
write(‘masukan sisi = ‘);
readln(sisi);
luaskubus:=6*sisi*sisi ;
writeln(‘luas permukaan kubus = ‘,luaskubus:4:1);
readln;
end;
‘b’ :
begin
write(‘masukan panjang = ‘);
read(panjang);
write(‘masukan lebar = ‘);
read(lebar);
write(‘masukan tinggi = ‘);
read(tinggi);
luasbalok:=2*(panjang*lebar)+2*(panjang*tinggi)+2*(lebar*tinggi) ;
writeln(‘luas permukaan balok = ‘,luasbalok:4:1);
readln;
end;
‘c’ :
begin
write(‘masukan panjang = ‘);
readln(panjang);
write(‘masukan lebar = ‘);
readln(lebar);
write(‘masukan tinggi = ‘);
readln(tinggi);
volumebalok:=panjang*lebar*tinggi ;
writeln(‘volume balok = ‘,volumebalok:4:1);
readln;
end;
‘d’ :
begin
write(‘masukan sisi = ‘);
readln(sisi);
volumekubus:=sisi*sisi*sisi ;
writeln(‘volume kubus = ‘,volumekubus:4:1);
readln;
end;
‘e’ :
begin
write(‘masukan jari-jari = ‘);
readln(jarijari);
write(‘masukan tinggi = ‘);
readln(tinggi);
volumekerucut:=pi*sqr(jarijari)*tinggi ;
writeln(‘volume kerucut = ‘,volumekerucut:4:1);
readln;
end;
else
writeln(‘sorry… incorrect action !!!’);

end;
writeln(‘ingin coba lagi(ya/tidak) ? :’);
readln(coba);
if coba =’ya’ then goto ulang else goto akhir;

end;
‘3’:
begin
clrscr;
writeln(‘_____________________________’);
writeln(‘* pilihan rumus *’);
writeln(‘* ============= *’);
writeln(‘* a) mol zat *’);
writeln(‘* b) molar *’);
writeln(‘* c) molal *’);
writeln(‘* d) kalor *’);
writeln(‘mau pilih yang mana ? *’);
writeln(‘silahkan masukan pilihan !! *’);
writeln(‘_____________________________’);
readln(pilihanrumus);
case pilihanrumus of

‘a’ :
begin
write(‘masukkan massa = ‘);
readln(massa);
write(‘masukan nilai atom relatif = ‘);
readln(ar);
mol:=massa/ar ;
writeln(‘mol zat = ‘,mol:4:1,’mol’);
writeln(‘is it right ?’);
readln;
end;
‘b’ :
begin
write(‘masukan mol zat = ‘);
readln(mol);
write(‘masukan volume = ‘);
readln(volume);
molar:=mol/volume ;
writeln(‘molar zat = ‘,molar:4:1,’mol/L’);
writeln(‘is it right ? ‘);
readln;
end;
‘c’ :
begin
write(‘masukan mol zat = ‘);
readln(mol);
write(‘masukan massa air(kg) = ‘);
readln(massa);
molal:=mol/massa ;
writeln(‘molal zat = ‘,molal:4:1,’mol/kg’);
writeln(‘is it right ?’);
readln;
end;
‘d':
begin
write(‘masukan massa = ‘);
readln(massa);
write(‘masukan kalor jenis = ‘);
readln(kalorjenis);
write(‘masukan suhu awal = ‘);
readln(T1);
write(‘masukan suhu akhir = ‘);
readln(T2);
kalor:=massa*kalorjenis*(T2-T1) ;
writeln(‘kalor zat = ‘,kalor:4:1,’joule’);
writeln(‘is it right ? ‘);
readln;
end ;
else
writeln(‘ sorry.. incorrect action ‘);
end;
writeln(‘ingin coba lagi(ya/tidak) ? :’);
readln(coba);
if coba =’ya’ then goto ulang else
goto akhir;

end;

else
writeln(‘sorry.. the case that you chosed has not registrated !!!’);
writeln(‘——————————————————–‘);
writeln(‘silahkan coba lagi !!!!’);
writeln(‘ingin coba lagi(ya/tidak) ? :’);
readln(coba);
if coba =’ya’ then goto ulang else
goto akhir;
end;
akhir :
clrscr;
writeln(‘*********************selesai*********************’);
writeln(‘## Terima kasih anda telah mencoba program ini ##’);
writeln(‘ untuk kritik dan saran silahkan kirim e-mail ke ‘);
writeln(‘__________ dicki_andesbay@yahoo.co.id ___________’);
end.

About these ads

Tentang andesbay113

simple ouside but perect inside
Tulisan ini dipublikasikan di Uncategorized. Tandai permalink.

Berikan Balasan

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s