#include"stdio.h"
#include"conio.h"
void main()
{
int i,kode[15],jumlah[15],jumdata=5;
char*produk;
float harga,total,disc,pembayaran;

printf("\nInput Data Penjualan");
for(i=0;i<jumdata;i++){
    printf("\nKode Produk :"); scanf("%d",&kode[i]);
    printf("\nJumlah Produk :"); scanf("%d",&jumlah[i]);
}
clrscr();
printf("\nInformasi Penjualan Produk");
printf("\n-------------------------------------------------------------------------------");
printf("\nNo Kode  Produk                  Harga   Jumlah    Total    Discount Pembayaran");
printf("\n-------------------------------------------------------------------------------");
for(i=0; i<jumdata; i++){
    if(kode[i]==1){
        produk="TV"; harga=2000000;
    }else if(kode[i]==2){
        produk="DVD"; harga=650000;
    }else if(kode[i]==3){
        produk="CD ROOM"; harga=450000;
    }
    total=harga*jumlah[i];
    if(total> 4000000)disc=0.1*total; else
    if(total< 4000000)disc=0;
    pembayaran=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%10.0f%10.0f"  ,harga,jumlah[i],total,disc,pembayaran);
    }
    printf("\n--------------------------------------------------------------------------------");
}

hasil printout


edit post

Quis Soal II (Kedua)

Posted on 2:05 AM, under

#include "iostream.h"
#include "conio.h"
#include "stdio.h"

main(){
float jp,a,b,c,d,bonus=0;
clrscr();
cout << "Bonus Sales \n-------------------------------- " ;
cout << "Masukkan jumlah pembelian : " ;
cin >> jp;
if (jp>=1000000){
    a=1000000;
    b=a*0.1;
    c=jp-a;
    d=c*0.15;
    bonus=d+a;
}else if(jp>=500000){
    bonus=jp*0.10;
}
cout << "Bonus : " << bonus;
}

edit post

Quis Online Soal I (Pertama)

Posted on 2:03 AM, under

#include "conio.h"
#include "stdio.h"

void main()
{
int j, totalj=0

clrscr();
for(j=1 ;j<=5 ;j++){
totalj+= j;
}
cout << "\n Jumlah=%d",totalj;
}

dengan output
15= 5 + 4 + 3 + 2 + 1

edit post