Hi…
welcome to my page in “We Are Knowledge”… Many IT knowledge you will getting in
here… therefore you must reading my this article…
This
article disscus about “Select Case in Pascal”. Ok.. do read my article..
Copy
this program then paste in your software likely “turbo pascal”, because I also
using it for making this program:
Example 1:
uses crt;
var
a : integer;
begin
clrscr;
writeln (' *** MENU OF FOODS ***');
writeln;
writeln ('1. NASI GORENG Rp. 8.000');
writeln ('2. NASI RAMES Rp. 7.000');
writeln ('3. NASI UDUK Rp. 5.000');
writeln;
write ('NUMBER ORDER : ');
readln (a);
case a of
1:
writeln ('YOU ARE CHOICE NASI GORENG FEE Rp. 8.000');
2:
writeln ('YOU ARE CHOICE NASI RAMES FEE Rp. 7.000');
3:
writeln ('YOU ARE CHOICE NASI UDUK FEE Rp. 5.000');
end;
writeln ('THANKS,.. PLEASE WAIT');
readln;
end.
And result :
If we input number 1 result :
writeln ('YOU ARE CHOICE
NASI GORENG');
writeln ('FEE Rp.
8.000');
writeln ('THANKS,..
PLEASE WAIT');
If we input number 2 result :
writeln ('YOU ARE CHOICE
NASI RAMES');
writeln ('FEE Rp.
7.000');
writeln ('THANKS,..
PLEASE WAIT');
if we input number 3 result :
writeln ('YOU ARE CHOICE
NASI UDUK');
writeln ('FEE Rp.
5.000');
writeln ('THANKS,..
PLEASE WAIT');
Note :::
Press in keyboard “alt +
F9” >> for compile this program
Press in keyboard “ctrl+
F9” >> for running this program
Please input your number
from 1 (one) until 3 (three) for looking result
logic :::
uses crt
>> this is
statement optional, and using in order to the statement “clrscr” we can use
Var a : integer
>> declare that
variable a is integer
Begin
>> starting the
program case
Clrscr
>> cleaning the output window
>> cleaning the output window
Writeln
>> printing in
output window
Readln
>> With this
statement ww can Input value (number) in
output window
Case
>> the statement
conditional likely “IF” using for choice one from other options
End
>> statement for
stoping program
Ok.. just it…
I hope you get what
you're looking for…
See you later friends..
No comments:
Post a Comment