Listing Program
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
main()
{
char nama[15],jenis[15];
int kain,stock,harga,total;
clrscr();
puts("-------------------------------------");
puts(" TOKO BAJU ");
puts("-------------------------------------");
puts(" KODE BARANG ");
puts("-------------------------------------");
puts("1. Kain Sutra RP.100000 ");
puts("2. Kain Katun RP.50000 ");
puts("3.Kain Kombed RP.40000 ");
puts("4.Kain karded RP.20000 ");
puts("-------------------------------------");
puts("Input Jenis Kain : ");cin>>kain;
puts("Input Stock Barang: ");cin>>stock;
cout<<"Input Harga Barang : ";cin>>harga;
switch(kain)
{
case 1:
strcpy(jenis," Kain Sutra");
harga=100000;
break;
case 2:
strcpy(jenis,"Kain Katun");
harga=50000;
break;
case 3:
strcpy(jenis,"Kain Kombed");
harga=40000;
break;
case 4:
strcpy(jenis,"Kain karded");
harga=stock*20000;
break;
default:
strcpy(jenis,"Anda Salah Kode");
harga=10;
break;
}
//harga=stock*harga;
clrscr();
cout<<"==============================="<<endl;
cout<<" STOCK DAN HARGA BARANG "<<endl;
cout<<"Nama Pembeli : "<<nama<<endl;
// cout<<"Nama Barang : "<<barang<<endl;
cout<<"Harga Barang : "<<harga<<endl;
cout<<"jumlah Stock Barang : "<<jumbel<<endl;
//cout<<"Total : "<<total;
getch();
Input :
Output :
kok gabisa dirunning mas?
BalasHapusndak di kasih using namespace std;
Hapus