Skip to content

Pengguaan case

October 4, 2008

Program tokoPD;
uses crt;
const dancowb = 10000;
dancows = 4250;
dancowk = 2100;
indob = 8500;
indos = 4000;
indok = 2025;
milob = 7750;
milos = 4000;
milok = 2200;
suprib = 9600;
supris = 5100;
suprik = 2600;
sustab = 17000;
sustas = 14500;
sustak = 8300;
ovalb = 11250;
ovals = 6500;
ovalk = 3200;
var
no : byte;
ukuran : char;
banyak : longint;
bayar : real;
begin
clrscr;
writeln(‘===============================================’);
writeln(‘ P & D Toserba’);
writeln(‘Susu yang tersedia di P & D Toserba : ‘);
writeln(‘1. Dancow’);
writeln(‘2. Indomilk’);
writeln(‘3. Milo’);
writeln(‘4. Suprima’);
writeln(‘5. Sustagen’);
writeln(‘6. Ovaltime’);
writeln(‘————————————–‘);
write(‘No susu : ‘); readln(no);
write(‘Ukuran (b:besar,s:sedang,k:kecil) : ‘); readln(ukuran);
write(‘Banyak barang : ‘); readln(banyak);
case no of
1 : begin
case ukuran of
‘b’ : bayar:=dancowb*banyak;
‘s’ : bayar:=dancows*banyak;
‘k’ : bayar:=dancowk*banyak;
else writeln(‘Ukuran salah !!’);
end;

Download source code lengkap nya di sini.

Leave a Comment

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

%d bloggers like this: