Mlente Banget

Tugas Pascal // Procedure – Mengubah huruf besar menjadi huruf kecil

Posted on: December 22, 2008


uses wincrt;
var
indek:integer;
kata,ngisilagi:string;
pilihan:char;

{Bismillah, pada sinau bareng mayuh, ngapurane wingi ora bisa upload,
jebulane anu nganggo procedure yah, aku olihe sing biasa, dadine ya kudu dikutak-katik dewek,
jan sewengi mbetetet,langsung baen ya pak2 kabeh}

{Kiye sing nang ngisor jenenge function seduluran karo procedure mlebu kluarga deklarasi, fungsine nggo
mendeklarasikan variabel ‘cilik; men bisa ngrubah ben dadi lowcase, soale nang pascal langka perintah lowcase,
sing ana mung upcase tok,
nek ‘cilik:=chr(ord(c))’ kiye bahasa kerene char function, dadi anu wis ana rumuse.
mudeng? lanjut pak..}

function cilik(c : char) : char;
begin
if (c >= #65) and (c <= #90) then
cilik := chr(ord(c) + 32)
else
cilik := c;
end;

{siki mulai procedure sing pertama, tek jenengi procedure menu, nek arep diubah ya ngonoh, fungsine
nggo deklarasi pilihan ben mengko bisa dipanggil lewat case of, mengko neng ngisor toli ana,
priwe? 86? siap 86! lanjut..}

procedure menu;
begin
writeln(‘*********************’);
writeln(‘       >>MENU<<      ‘);
writeln(‘*********************’);
writeln(‘1. Upper’);
writeln(‘2. Lower’);
writeln(‘3. Keluar’);
writeln;
writeln;
write(‘Pilihan Kamoe:’);readln(pilihan);
end;

{procedure sing ke 2 kiye fungsine nggo ngrubah maring huruf gedhe}
procedure kapital;
begin

{for indek ngisor kiye artine= variabel input ‘kata’ sing dimasukna mulai sekang
digit siji nganti ‘length’ utawane sedawane kata kuwe dirubah maring kapital,
nek arep diganti dadi
‘for indek:=1 to 300 do’ ya bisa, artine sing di rubah maring kapital digit 1 nganti 300.
ps: upcase perintah inti sing merekna dadi kapital.}

for indek:=1 to length(kata) do
kata[indek]:=upcase(kata[indek]);
writeln(kata);
end;

{nek sing ngisor kiye procedure sing terakhir (mbok bener mung dikongkon gawe 3 procedure tok kone dosene?,
deleng si nang slide)
kiye sing ana hubungane karo deklarasi function mau nduwur kae, nek langka deklarasi function sing nduwur
kae arep ngasi mencret ya
procedure ora bakal gelem dadi}

procedure hurufkecil;
begin

for indek := 1 to length(kata) do
kata[indek] := cilik(kata[indek]);
writeln(kata);

end;

{label kiye sing nggo pilihan arep ngisi maning ora…
betul sekali! nganggo perintah goto}

label
lagi;
{nah kiye program utamane, nek kiye tah wis pada pinter mbok? ben minggu gawe laporan koh
ya wis paham lah ya, nek urung ya sms bae maring dosene, takon}

begin
lagi:
clrscr;
writeln(‘                  ==============================’);
writeln(‘                        Program Sulap Huruf     ‘);
writeln(‘                  ==============================’);
writeln;
write(‘Masukan Kata:’);
readln(kata);
writeln;
writeln;
menu;
case pilihan of
‘1’ : kapital;
‘2’ : hurufkecil;
‘3’ : donewincrt;

end;

write(‘Mo Nyulap Lagi?’);readln(ngisilagi);
if ((ngisilagi=’y’) or (ngisilagi=’Y’)) then goto lagi else donewincrt;

end.

{Alhamdulillah, matur nuwun kanggo atensine,
salame dikirimna kanggo yayu tus, yu rukiyah, kang harjo, kang sapto, yu dar sing mbekayune yu tus kae, sing ayu dewek,
hehehe, selamat mencoba lah, sing ngganteng dewek

-hendrat sasongko-
08.11.0782

}

Kontributor   :

hendrat sasongko – http://sasongko.duniakata.net

1 Response to "Tugas Pascal // Procedure – Mengubah huruf besar menjadi huruf kecil"

terima kasih udah share…saya liat2&coba2 buat tugas saya..
SEMPURNA..(wkwkwkwkwk)
terima kasih banyak..

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

About Me

Unknown unordinary creature
 






December 2008
M T W T F S S
« Nov   Jan »
1234567
891011121314
15161718192021
22232425262728
293031  

Blog Stats

  • 132,030 hits

Your Information

Tracker

%d bloggers like this: