#include "conio.h"
void main () {
int i , kode [5] , jumlah [5] , jumdata = 3 ;
char * produk ;
float harga , total, disc=0,tobay;
clrscr();
printf ("\n input data penjualan") ;
for (i=0 ; i<=jumdata ; i++) {
printf ( "\n kode produk : ") ;
scanf ("%d" , &kode [i] ) ;
printf ( "\n jumlah produk : ") ;
scanf ("%d" , &jumlah [i]) ;
}
clrscr () ;
printf ("\n informasi penjualan produk") ;
printf ("\n ----------------------------------------") ;
printf ("\n No kode produk harga jumlah total discount pembayaran") ;
printf ("\n ----------------------------------------") ;
for (i=0 ; i <=jumdata ; i++ ) {
if (kode [i] == 1){
produk = "TV" ; harga = 20000000 ;
}else if (kode [i] == 2) {
produk = "DVD" ; harga = 650000 ;
}else if (kode[i] ==3) {
produk = "CD ROOM" ; harga = 4500000 ;
}
total = harga * jumlah [i] ;
{
if (total>4000000){
disc=0.2*total;
}else if (total<2000000){
disc=0.15*total;
}
tobay=total-disc;
gotoxy (1, 6+i) ; printf (" %i %d %s" , i+1 , kode [i] , produk) ;
gotoxy (30 ,6+i) ; printf ("%10.0f %i %10.0f %1.f %10.0f" , harga , jumlah [i] , total , disc, tobay) ;
}
printf ("\n---------------------------------------------") ;
}
}
Selamat Mencoba semoga bermanfaat bagi teman-teman semua....
Tugas Bahasa Pemrograman
Jangan lupa tinggalin comen ya...








0 komentar:
Posting Komentar