pascal fundamentals

uses wincrt;
var
pass,name,n,m,nilai : string;
pilih:integer;
a,x,i,s : integer;
panjang,lebar,tinggi,alas,jari,sisi,tinggiT,jariT,panjangL,lebarL : real;
lagi,oper,c,enter:char;
hasil:real;
q,w,e,r,t,y : string;
res,b,rseri:integer;
rpar:real;
const
phi=3.14;

procedure segitiga;
begin
writeln(‘luas segitiga = ‘,((alas*tinggi)/2):4:2,’ cm persegi’);
writeln(‘keliling segitiga = ‘,(3*alas):4:2,’ cm persegi’);
end;
procedure segiempat;
begin
writeln(‘luas segiempat = ‘,(panjang*lebar):4:2,’ cm persegi’);
writeln(‘keliling segiempat = ‘,(2*(panjang+lebar)):4:2,’ cm persegi’);
end;
procedure lingkaran;
begin
writeln(‘keliling lingkaran = ‘,(2*phi*jari):4:2,’ cm persegi’);
writeln(‘luas lingkaran = ‘,(phi*(sqr(jari))):4:2,’ cm persegi’);
end;
procedure kubus;
begin
writeln(‘Volume Kubus = ‘,(sisi*sisi*sisi):4:2,’ cm kubik’);
end;
procedure piramid;
begin
writeln(‘Volume Piramid = ‘,(((panjangL*lebarL)*tinggi)/3):4:2,’ cm kubik’);
end;
procedure tabung;
begin
writeln(‘Volume Tabung = ‘,((phi/4)*(sqr(2*jariT))*tinggiT):4:2,’ cm kubik’);
end;
procedure Kerucut;
begin
writeln(‘Volume Kerucut = ‘,((phi/3)*(sqr(jari))*tinggi):4:2,’ cm kubik’);
end;
procedure bola;
begin
writeln(‘Volume Bola = ‘,(4.189*(jari*jari*jari)):4:2,’ cm kubik’);
end;

begin

n:=’tommy’;
m:=’123456′;
repeat;
clrscr;
writeln(‘ *====================================*’);
writeln(‘ *========= =========*’);
writeln(‘ *============TOMMY-EC2A==============*’);
writeln(‘ *========= =========*’);
writeln(‘ *====================================*’);
writeln(‘ *= enter username = =*’);
writeln(‘ *= enter password = =*’);
writeln(‘ *====================================*’);
writeln(‘ *– love is colder than the death –*’);
writeln(‘ *====================================*’);

gotoxy(44,6); readln(name);
gotoxy(44,7);
repeat
c:=readkey;
until ord(c)<>8;
write(‘*’);
pass:=c;
repeat
c:=readkey;
until ord(c)<>8;
write(‘*’);
pass:=pass+c;
repeat
c:=readkey;
until ord(c)<>8;write(‘*’);
pass:=pass+c;
repeat
c:=readkey;
until ord(c)<>8;write(‘*’);
pass:=pass+c;
repeat
c:=readkey;
until ord(c)<>8;write(‘*’);
pass:=pass+c;
repeat
c:=readkey;
until ord(c)<>8;write(‘*’);
pass:=pass+c;
repeat
enter:=readkey;
until
ord(enter)=13;
until
(pass=m) and (name=n) ;

begin
repeat
clrscr;
writeln(‘ |=============================================|’);
writeln(‘ |WELCOME TO THE BAND OF BROTHERS PLATFORM TEAM|’);
WRITELN(‘ |———————————————|’);
writeln(‘ |programmed by tommy agustianto elektronika 2A|’);
writeln(‘ | |’);
writeln(‘ | 1. deret bilangan |’);
writeln(‘ | 2. sepuluh pangkat n |’);
writeln(‘ | 3. deret pangkat 2 |’);
writeln(‘ | 4. deret penjumlahan bilangan 2 |’);
writeln(‘ | 5. cek IndexNilai huruf |’);
writeln(‘ | 6. Hitung Faktorial |’);
writeln(‘ | 7. kalkulator_keren Boo! |’);
writeln(‘ | 8. tentang EC-2A |’);
writeln(‘ | 9. biodata Tommy |’);
writeln(‘ | 10. Resistor Seri |’);
writeln(‘ | 11. Resistor Paralel |’);
writeln(‘ | 12. Rumus Bangun Datar |’);
writeln(‘ | 13. Rumus Bangun Ruang |’);
writeln(‘ | 14. Keluar Program |’);
writeln(‘ |———————————————|’);
write( ‘ please enter your choice = ‘); readln(pilih);

case pilih of
1 : begin
clrscr;
write(‘mau menghitung sampai berapa = ‘);
readln(s);
for i:=1 to s do
begin
write(i,’ ‘);
end;
writeln;
write(‘mau menghitung lagi (Y/T) = ‘);
readln(lagi);
end;

2 : begin
clrscr;
write(‘Hitung sepuluh pangkat berapa = ‘);
readln(s);
a:=1;
for i:=1 to s do
begin
a:=a*10;
end;
writeln(‘hasilnya adalah = ‘,a);
write(‘Mau hitung lagi ndak (Y/T) = ‘);
readln(lagi);
end;

3 : begin
clrscr;
write(‘Berapa Baris = ‘);
readln(s);
clrscr;
writeln(‘——————————–‘);
writeln(‘—Bilangan———Pangkat 2—‘);
writeln(‘——————————–‘);
for i:=1 to s do
begin
writeln(i:8,(i*i):18);
end;
writeln (‘——————————–‘);
write(‘Mau hitung lagi ndak (Y/T) = ‘);
readln(lagi);
end;
4 : begin
clrscr;
write(‘masukan banyak penjumlahan = ‘);
readln(s);
a:=0;
for i:=1 to s do
begin

a:=a+2;
end;
writeln(‘nilai dari ‘,s,’ hasil penjumlahan bilangan 2 adalah = ‘,a);
write(‘Hitung Lagi (Y/T) = ‘);
readln(lagi);
end;
5 : begin
clrscr;
write(‘berapa nilai kamu = ‘);
readln(s);
case s of
80..100 : nilai:=’A’;
65..79 : nilai:=’B’;
50..64 : nilai:=’C’;
30..49 : nilai:=’D’;
else
nilai:=’E …selamat anda di DO!’;
end;
writeln(‘Indeks Huruf Anda adalah = ‘,nilai);
write(‘Mau Cek lagi ndak (Y/T) = ‘);
readln(lagi);
end;

6 : begin
clrscr;

write(‘berapa faktorial = ‘);
readln(s);
a:=1;
for i:= 1 to s do
begin
a:=a*i;
write(i,’ x ‘);
end;
write(‘1’);
writeln(‘ [ ‘,s,’ faktorial adalah = ‘,a,’ ]’);
write (‘mau ngitung lagi ndakk (Y/T) = ‘);
readln(lagi);
end;

7: begin
clrscr;
writeln(‘xalculator go..KiLL!’);
writeln(‘— Tommy A.S.N. —‘);
writeln(‘——<enter>——-‘);
readln;
clrscr;
writeln(‘[ ][ ][ ]’);
writeln(‘[masukin bilangan dan operatornya]’);
writeln(‘ [operator : * – + /]’);
gotoxy(2,1);
readln(a);
gotoxy(17,1);
readln(oper);
gotoxy(20,1);
readln(s);
clrscr;
case oper of
‘*’ : hasil:=a*s;
‘/’ : hasil:=a/s;
‘-‘ : hasil:=a-s;
‘+’ : hasil:=a+s;
end;
writeln(‘Hasil dari ‘,a,’ ‘,oper,’ ‘,s,’ adalah ‘,hasil:4:2);
write (‘mau hitung lagi ndaxx (Y/T) = ‘);
readln(lagi);
end;

8 : begin
clrscr;
writeln(‘ec2a ON-LINE website’);
writeln(‘chatroom #lapaxEC2A’);
writeln(‘lapax.ec2a@gmail.com’);
writeln;
write(‘masukan nama kamu = ‘);
readln(q);
clrscr;
writeln(‘selamat datang ‘,q,’ di dunia kegelapan EC2A’);
writeln;
writeln(‘ec2a adalah segelincir orang-orang yang tergelincir’);
writeln(‘yang niat masuk tu kelas..sedih ya! walaupun begitu’);
writeln(‘kita tetep seneng ko…gw aja (penulis) yang IPnya ‘);
writeln(‘cuma 2,48 masi btah tinggal dsitu..hebatkn guw!!!!!’);
writeln(‘nama anak2nya adalah : ‘);
writeln(‘maul,arief,and1,reZa,ruby(buluk),mamad(madau),imam’);
writeln(‘ ferry(gori),faiz,AaS,TomY,hAry,Jo,darma(moKer),’);
writeln(‘ AdHit,AgeNk,sony(udah caw),diwan(lemots),jAbbAr’);
writeln(‘ yuNi,LeLa,NoRa,tyCha’);
writeln;
writeln(‘dah dulu ya!’);
write(‘balik lagi ke menu utama (Y/T) = ‘);
readln(lagi);
end;

9 : begin
clrscr;
writeln(‘Real Name : Tommy Agustianto Satria Nugroho’);
writeln(‘class : Electronics Industry A 06’);
writeln(‘address : jakarta – bogor – tangerang’);
writeln(‘hobby : sleeping and watching’);
writeln(‘ambition : programmer success’);
writeln(‘contacts : satria.nt@gmail.com’);
writeln(‘girlfren : ?????? ‘);
writeln;
writeln;
write(‘back to main page (Y/T) = ‘);
readln(lagi);
end;

10 : begin
clrscr;
writeln (‘-Hitung R seri-‘);
write(‘masukan banyak R = ‘);
readln(b);
rseri:=0;
for i:=1 to b do
begin
write(‘masukan nilai R’,i,’ = ‘);
readln(res);
rseri:=res+rseri;
end;
clrscr;
writeln(‘Harga R-seri pengganti adalah = ‘,rseri,’ Ohm’);
write (‘balik ke menu (y/t) = ‘);
readln(lagi);
end;
11 : begin
clrscr;
writeln (‘-Hitung R ParaLel’);
write(‘masukan banyak R = ‘);
readln(b);
rpar:=0;
for i:=1 to b do
begin repeat
write(‘masukan nilai R’,i,’ = ‘);
readln(res);
until res<>0;
rpar:=(1/res)+rpar;

end;
clrscr;
writeln(‘Harga R-Paralel pengganti adalah = ‘,(1/rpar):3:2,’ Ohm’);
write (‘balik ke menu (y/t) = ‘);
readln(lagi);
end;

12 : begin
clrscr;
writeln(‘SEGIEMPAT’);
write(‘masukan panjang = ‘);
readln(panjang);
write(‘masukan lebar = ‘);
readln(lebar);
writeln(‘SEGITIGA’);
write(‘masukan alas = ‘);
readln(alas);
write(‘masukan tinggi = ‘);
readln(tinggi);
writeln(‘LINGKARAN’);
write(‘masukan jari-jari = ‘);
readln(jari);
clrscr;
writeln(‘——- hasil perhitungan BANGUN DATAR ——–‘);
writeln;
writeln(‘ — segitiga –‘);
segitiga;
writeln;
writeln(‘ — segiempat –‘);
segiempat;
writeln;
writeln(‘ — lingkaran –‘);
lingkaran;
writeln;
write(‘balik to menu (y/t) = ‘);
readln(lagi);
end;

13 : begin
clrscr;
writeln(‘BANGUN RUANG’);
writeln(‘————‘);
writeln;
writeln(‘KUBUS’);
write (‘masukan sisi = ‘);
readln(sisi);
writeln(‘PIRAMIDE’);
write (‘masukan lebar = ‘);
readln(lebarL);
write (‘masukan panjang = ‘);
readln(panjangL);
write (‘masukan tinggi = ‘);
readln(tinggi);
writeln(‘TABUNG’);
write (‘masukan jari-jari = ‘);
readln(jariT);
write (‘masukan tinggi = ‘);
readln(tinggiT);
writeln(‘BOLA’);
write (‘masukan jari-jari = ‘);
readln(jari);
clrscr;
writeln(‘——–TOMZ INzTrUmeNtZ——-‘);
writeln(‘c o m p u t e r s c i e n c e’);
writeln;
writeln(‘KUBUS Result’);
kubus;
writeln(‘——————————-‘);
writeln(‘BOLA Result’);
bola;
writeln(‘——————————-‘);
writeln(‘PiraMiDe Result’);
piramid;
writeln(‘——————————-‘);
writeln(‘KeruCut ResULt’);
kerucut;
writeln(‘——————————-‘);
writeln(‘TaBung ResuLt’);
tabung;
writeln(‘——————————-‘);
writeln(‘——————————-‘);
writeln;
write(‘balik to menu (Y/T)? ‘);
readln(lagi);
end;

14 : begin
clrscr;
writeln(‘[[[[[[ Keluar Program? ]]]]]’);
writeln(‘ enter huruf T untuk keluar ‘);
writeln(‘ terima kasih ‘);
gotoxy(24,1);
readln(lagi);
clrscr;
gotoxy(30,1);
writeln(‘Terima Kasih Udah Make Software Ku’);
gotoxy(30,2);
writeln(‘ tommy agustianto – 130601043Y ‘);
gotoxy(30,3);
writeln(‘ hehehehehe’);

end;

end;
until lagi=’t’;
end;

end.

Advertisements
pascal fundamentals

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s