Mesran

Hanya ingin berbagi kebaikan dan mendapatkan kebaikan yang lain.

LATIHAN LATIHAN PASCAL

Ketikkanlah program dibawah ini.

USES CRT ;
Var
Lagi : Char ;
Kode : String[5] ;
Nama : String[30] ;
Harga : Longint  ;
Jumlah : Byte ;
Total, Disc, Bayar : Real ;

BEGIN

REPEAT
TextColor(1) ; TextBackGround(1) ;
CLRSCR ;
Gotoxy (30, 10 ) ; Write (' INPUT DATA PENJUALAN PRODUK ') ;
Gotoxy (30, 11 ) ; Write (' =================================') ;
Gotoxy (30, 12 ) ; Write (' Kode Produk  :                      Ket : [001,002,003]') ;
Gotoxy (30, 13 ) ; Write (' Nama           :') ;
Gotoxy (30, 14 ) ; Write (' Harga           :') ;
Gotoxy (30, 15 ) ; Write (' Jumlah          :') ;
Gotoxy (30, 16 ) ; Write (' Total Harga   :') ;
Gotoxy (30, 17 ) ; Write (' Discount        :') ;
Gotoxy (30, 18 ) ; Write (' Pembayaran  :') ;
Gotoxy (30, 19 ) ; Write (' =================================') ;
Gotoxy (30, 20 ) ; Write (' Masih Isi Lagi [Y/T]  : ') ;
Gotoxy (30, 21 ) ; Write (' =================================') ;

Gotoxy (45, 12 ) ; Readln( Kode );

IF Kode='001' Then
BEGIN
Nama :='TV LG 14 Inchi' ; Harga := 1000000 ;
END
Else IF Kode='002' Then
BEGIN
Nama :='DVD Player' ; Harga := 650000 ;
END ;
Else IF Kode='003' Then
BEGIN
Nama :='Flash Disk 4 Gbyte' ; Harga := 100000 ;
END ;

Gotoxy (45, 13 ) ; Write( Nama );
Gotoxy (45, 14 ) ; Write( Harga );
Gotoxy (45, 15 ) ; Readln ( Jumlah );

Total := Harga * Jumlah ;
IF Total > 3000000 Then
Disc := 0,1 * Total ;
Else
Disc := 0 ;
Bayar := Total-Disc ;

Gotoxy (45, 16 ) ; Write( Total:10:2 );
Gotoxy (45, 17 ) ; Write( Disc:10:2 );
Gotoxy (45, 18 ) ; Write( Bayar :10:2 );
Gotoxy (53, 20 ) ; Lagi := Readkey ;
UNTIL Lagi IN ['T','t'] ;

END.

Pertanyaan : Sebutkanlah kesalahan kesalahan dari program diatas ?

Filed under: Pemrograman Pascal,

Terima kasih telah memberikan komentar anda.

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

Archives Per Tahun

%d bloggers like this: