Kamis, 17 Januari 2013

membuat program barang di pascal


program barang;
uses crt;
var
   nBarang : string;
   cBarang,TTL,JMLH,uByr,KBL : real;
   HRG : integer;
   begin
        clrscr;
        gotoxy(4,3); write('kode barang = '); readln(cBarang);
        gotoxy(4,4); write('nama barang = '); readln(nBarang);
        gotoxy(4,5); write('harga       = '); readln(HRG);
        gotoxy(4,6); write('jumlah beli = '); readln(JMLH);
        TTL := (HRG * JMLH);
        gotoxy(4,7); write('TOTAL       = ', TTL:0:0);
        gotoxy(4,10); write ('Uang bayar = '); readln(uByr);
        KBL := (uByr - TTL);
        gotoxy(4,12); write('Uang kembali = ', KBL:9:2);
        readln
end.



Artikel Terkait:

0 komentar: