RSS

Praktikum 1 - Alpro 1 - Pengenalan Pascal

Dibawah ini adalah script codenya :
PROGRAM MINIMARKET_ILKOM;
USES CRT;
VAR
h1, h2, h3, h4, h5, j, stot1, stot2, stot3, stot4, stot5: longint;
d, total: real;

Begin
clrscr;
writeln('|-------------------MINIMARKET ILKOM-------------------|');
writeln('|------------------------------------------------------|');
writeln('|No|   Barang   |   Harga   |  Jumlah  |   Sub Total   |');
writeln('|1 |Sabun       |Rp         |          |Rp             |');
writeln('|2 |Bedak       |Rp         |          |Rp             |');
writeln('|3 |Telur       |Rp         |          |Rp             |');
writeln('|4 |Permen      |Rp         |          |Rp             |');
writeln('|5 |Gula        |Rp         |          |Rp             |');
writeln('|-------------------------------Diskon |Rp             |');
writeln('|-------------------------------Total  |Rp             |');

        Begin
        gotoxy(21,4); write(''); read(h1);
        gotoxy(34,4); write(''); read(j);
        gotoxy(45,4); stot1:=(h1*j); write(stot1);

        gotoxy(21,5); write(''); read(h2);
        gotoxy(34,5); write(''); read(j);
        gotoxy(45,5); stot2:=(h2*j); write(stot2);

        gotoxy(21,6); write(''); read(h3);
        gotoxy(34,6); write(''); read(j);
        gotoxy(45,6); stot3:=(h3*j); write(stot3);

        gotoxy(21,7); write(''); read(h4);
        gotoxy(34,7); write(''); read(j);
        gotoxy(45,7); stot4:=(h4*j); write(stot4);

        gotoxy(21,8); write(''); read(h5);
        gotoxy(34,8); write(''); read(j);
        gotoxy(45,8); stot5:=(h5*j); write(stot5);

        gotoxy(45,9); d:=0.1*(stot1+stot2+stot3+stot4+stot5);
        write(d:0:2,'-');
        gotoxy(45,10); total:=(stot1+stot2+stot3+stot4+stot5)-d;
        write(total:0:2,'-');
        Readkey;
        End;

End.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar