- SOURCE CODE
uses crt;
var
x : integer;
begin
clrscr;
write('Masukkan umur anda : ');
readln(x);
writeln;
case x of
0..1:writeln('You are a baby !');
2..11:writeln('You are a kid !');
12..17:writeln('You are a teenager !');
18..23:writeln('You are a young adult !');
24..39:writeln('You are a adult !');
40..55:writeln('You are a aged !');
end;
readkey;
end.
- PENJELASAN SOURCE CODE
uses crt; {Deklarasi unit CRT}
var {Variabel}
x : integer; {Inisiasi variabel}
begin {Awal instruksi program}
clrscr; {Membersihkan layar}
write('Masukkan umur anda : '); {Cetak Masukkan umur anda :}
readln(x); {Baca variabel x}
writeln; {Cetak baris}
case x of {Jika kasus input ? = x maka akan}
0..1:writeln('You are a baby !'); {x = 0..1 Cetak You are a baby !}
2..11:writeln('You are a kid !'); {x = 2..11 Cetak You are a kid !}
12..17:writeln('You are a teenager !'); {x = 12..17 Cetak You are a teenager !}
18..23:writeln('You are a young adult !'); {x = 18..23 Cetak You are a young adult !}
24..39:writeln('You are a adult !'); {x = 24..39 Cetak You are a adult !}
40..55:writeln('You are a aged !'); {x = 40..55 Cetak You are a aged !}
end; {Akhir instruksi kondisi}
readkey; {Instruksi untuk menunggu}
end. {Akhir instruksi program}
- PRINT SCREEN OUTPUT
Untuk mempermuda anda dalam mempelajari pemograman dengan menggunakan bahasa Pascal, admin telah menyediakan file Source code, Penjelasan source code, Output program, Flowchart dari source code, serta file pascalnya. Anda dapat mendownloadnya secara gratis di link download di bawah ini.
- Title Program : Menentukan status menggunakan umur
- Source Code .pdf : .:_Download_:.
- Flowchart .png : .:_Download_:.
- Program .pas : .:_Download_:.
- Password : kamuspascal.blogspot.com
Jika anda tidak tahu bagaimana cara mendownload file-file di atas klik Disini, untuk mempelajarinya.
No comments:
Post a Comment
"Terima kasih telah mengunjungi dan membaca blog saya, silahkan tinggalkan komentar anda, Terima kasih."