--------------------------------------------------------------------------------------------------------------------------
program Menentukan_Harga_Total;
{I.S. : User memasukkan total belanja}
{F.S. : Menampilkan diskon harga dan total bayar}
uses crt;
var
NilaiTot : integer;
Diskon,Total : real;
begin
window(15,6,65,18);textbackground(red);clrscr;
gotoxy(11,2);write('Program Menentukan Harga Total');
gotoxy(11,3);write('==============================');
//Memasukkan nilai total
gotoxy(5,5);write('Masukkan Nilai Total Belanja : Rp. ');readln(NilaiTot);
//Menentukan diskon
if (NilaiTot > 100000)
then
Diskon := NilaiTot * 0.1
else
Diskon := 0;
//Menghitung total bayar
Total := NilaiTot - Diskon;
//Menampilkan diskon dan total bayar
gotoxy(5,6);write('Diskon : Rp. ',Diskon:0:2);
gotoxy(5,7);write('____________________________________________-');
gotoxy(5,8);write('Total Bayar : Rp. ',Total:0:2);
readln;
end.
--------------------------------------------------------------------------------------------------------------------------
Download Scriptnya :
catatan :
hargailah tulisan orang lain, jika anda mengcopy-paste harap cantumkan link sumber.
0 komentar