Program Minimarket Sederhana Lengkap C++
Ini merupakan Tugas Akhir Semester yang saya buat pada mata kuliah Pemrograman Dasar menggunakan bahasa pemrograman C++
Waktu itu semester pertama saya masuk di jurusan Informatics Engineering
Silahkan di Liat dan Pelajari Program yang telah saya buat ini.
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include <stdio.h>
using namespace std;
COORD coord={0,0};
void gotoxy(int x,int y)
{
coord.X=x;
coord.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
struct data1
{
int beras=100,gula=200,minyak=200,tepung=200,telur=300,sirup=150,aqua=500,pocari=300,teh=450,soda=200,sabun=400,sampo=200,deterjen=500,
pewangi=200,pasta=300,mie=500,biskuit=500,wafer=500,kecap=500,roti=500,pena=500,buku=500,kotak=250,penghapus=250,tipex=250;
int hberas=60000,hgula=8000,hminyak=13500,htepung=10000,htelur=6000,hsirup=12000,haqua=3000,hpocari=5000,hteh=2500,hsoda=6000,hsabun=6000,hsampo=7000,
hdeterjen=10000,hpewangi=9000,hpasta=4000,hmie=2000,hbiskuit=5000,hwafer=2500,hkecap=6000,hroti=3000,hpena=3000,hbuku=3000,hkotak=5000,hpenghapus=2000,htipex=4000;
int bberas=55000,bgula=7500,bminyak=12500,btepung=9500,btelur=5500,bsirup=11500,baqua=2500,bpocari=4500,bteh=2000,bsoda=5500,bsabun=5500,bsampo=6000,bdeterjen=9500,
bpewangi=8500,bpasta=3500,bmie=1700,bbiskuit=4500,bwafer=2000,bkecap=5500,broti=2500,bpena=2500,bbuku=2500,bkotak=4500,bpenghapus=1500,btipex=3500;
int uberas=5000,ugula=500,uminyak=1000,utepung=500,utelur=500,usirup=500,uaqua=500,upocari=500,uteh=500,usoda=500,usabun=500,usampo=500,udeterjen=500,
upewangi=500,upasta=500,umie=300,ubiskuit=500,uwafer=500,ukecap=500,uroti=500,upena=500,ubuku=500,ukotak=500,upenghapus=500,utipex=500;
};
data1 barang;
struct data2
{
string namabarang[200];
int untung=0;
};
data2 penjualan;
void menu();
void stock_barang();
void distributor();
void transaksi();
void hargasembako();
void sembako();
void minuman();
void perlengkapan();
void makanan_ringan();
void alat_tulis();
void jenisbarang();
void untung1();
void menu()
{
system("cls");
int pilih;
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(40,4);cout<< "DENI MINI MARKET";
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(40,6);cout<< "1. Stock Barang"<<endl;
gotoxy(40,7);cout<< "2. Data Distributor"<<endl;
gotoxy(40,8);cout<< "3. Transaksi "<<endl;
gotoxy(40,9);cout<< "4. Untung"<<endl<<endl<<endl;
cout<<"\t\t\t Pilih Menu [1/2/3/] : ";
cin>>pilih;
if (pilih == 1)
{
stock_barang();
}else if (pilih == 2)
{
distributor();
}
else if (pilih ==3)
{
transaksi();
}
else if(pilih==4){
untung1();
}else
{
exit;
}
}
void untung1(){
cout<<"\n\n\t\t\t KEUNTUNGAN = "<<penjualan.untung;
char kembali;
cout<<"\n\n\t\t\t Kembali Ke Menu [Y/T] ? ";
cin>>kembali;
if(kembali=='y')
{
menu();
}else
{
system("exit");;
}
}
void jenisbarang(){
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>JENIS BARANG<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<<"|";gotoxy(40,6);cout<< "[1] SEMBAKO";gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<<"|";gotoxy(40,7);cout<< "[2] Minuman";gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<<"|";gotoxy(40,8);cout<< "[3] Perlengkapan ";gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<<"|";gotoxy(40,9);cout<< "[4] Makanan Ringan";gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<<"|";gotoxy(40,10);cout<< "[5] Alat tulis ";gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl;
}
void sembako(){
cout<< "\t\t\t\t| >>Sembako<< |"<<endl;
cout<< "\t\t\t\t| [A] Beras 5 Kg = "<<barang.beras<<" karung |"<<endl;
cout<< "\t\t\t\t| [B] Gula 1/2 Kg = "<<barang.gula<<" bungkus |"<<endl;
cout<< "\t\t\t\t| [C] Minyak Goreng = "<<barang.minyak<<" bungkus |"<<endl;
cout<< "\t\t\t\t| [D] Tepung = "<<barang.tepung<<" bungkus |"<<endl;//gudang.tepung=200;
cout<< "\t\t\t\t| [E] Telur 4 Butir = "<<barang.telur<<" butir |"<<endl;//gudang.telur=300;
}
void hargasembako(){
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>SEMBAKO<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<< "| [A] Beras 5 Kg = "<<barang.hberas<<" /karung";gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<< "| [B] Gula 1/2 Kg = "<<barang.hgula<<" /bungkus";gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<< "| [C] Minyak Goreng = "<<barang.hminyak<<" /bungkus";gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [D] Tepung = "<<barang.htepung<<" /bungkus";gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [E] Telur 4 Butir = "<<barang.htelur<<" /butir";gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl;
}
void hargaminuman(){
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>Minuman<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<< "| [A] Sirup = "<<barang.hsirup<<" botol";gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<< "| [B] Aqua = "<<barang.haqua<<" botol";gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<< "| [C] Pocari Sweat = "<<barang.hpocari<<" botol";gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [D] Teh Kotak = "<<barang.hteh<<" kotak";gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [E] Minuman Bersoda = "<<barang.hsoda<<" botol";gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl;
}
void minuman(){
cout<< "\t\t\t\t| >>Minuman<< |"<<endl;
cout<< "\t\t\t\t| [A] Sirup = "<<barang.sirup<<" botol |"<<endl;//gudang.sirup=150;
cout<< "\t\t\t\t| [B] Aqua = "<<barang.aqua<<" botol |"<<endl;//gudang.aqua=500;
cout<< "\t\t\t\t| [C] Pocari Sweat = "<<barang.pocari<<" botol |"<<endl;//gudang.pocari=300;
cout<< "\t\t\t\t| [D] Teh Kotak = "<<barang.teh<<" kotak |"<<endl;//gudang.tk=450;
cout<< "\t\t\t\t| [E] Minuman Bersoda = "<<barang.soda<<" botol |"<<endl;//gudang.mb=200;
}
void hargaperlengkapan(){
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>Perlengkapan<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<< "| [A] Sabun Mandi = "<<barang.hsabun;gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<< "| [B] Shampo = "<<barang.hsampo;gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<< "| [C] Deterjen = "<<barang.hdeterjen;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [D] Pewangi Pakaian = "<<barang.hpewangi;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [E] Pasta Gigi = "<<barang.hpasta;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl;
}
void perlengkapan(){
cout<< "\t\t\t\t| >>Perlengkapan<< |"<<endl;
cout<< "\t\t\t\t| [A] Sabun Mandi = "<<barang.sabun<<" |"<<endl;//gudang.sabun=400;
cout<< "\t\t\t\t| [B] Shampo = "<<barang.sampo<<" |"<<endl;//gudang.sampo=200;
cout<< "\t\t\t\t| [C] Deterjen = "<<barang.deterjen<<" |"<<endl;
cout<< "\t\t\t\t| [D] Pewangi Pakaian = "<<barang.pewangi<<" |"<<endl;
cout<< "\t\t\t\t| [E] Pasta Gigi = "<<barang.pasta<<" |"<<endl;
}
void hargamakanan_ringan(){
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>Makanan Ringan<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<< "| [A] Mie Instan = "<<barang.hmie;gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<< "| [B] Roti = "<<barang.hroti;gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<< "| [C] Biskuit = "<<barang.hbiskuit;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [D] Wafer = "<<barang.hwafer;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [E] Kecap = "<<barang.hkecap;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl;
}
void makanan_ringan(){
cout<< "\t\t\t\t| >>Makanan Ringan<< |"<<endl;
cout<< "\t\t\t\t| [A] Mie Instan = "<<barang.mie<<" |"<<endl;
cout<< "\t\t\t\t| [B] Roti = "<<barang.roti<<" |"<<endl;
cout<< "\t\t\t\t| [C] Biskuit = "<<barang.biskuit<<" |"<<endl;
cout<< "\t\t\t\t| [D] Wafer = "<<barang.wafer<<" |"<<endl;
cout<< "\t\t\t\t| [E] Kecap = "<<barang.kecap<<" |"<<endl;
}
void hargaalat_tulis(){
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>Alat Tulis<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<< "| [A] Pena = "<<barang.hpena;gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<< "| [B] Buku Tulis = "<<barang.hbuku;gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<< "| [C] Kotak Pensil = "<<barang.hkotak;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [D] Penghapus = "<<barang.hpenghapus;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [E] Tipe X = "<<barang.htipex;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl;
}
void alat_tulis(){
cout<< "\t\t\t\t| >>Alat Tulis<< |"<<endl;
cout<< "\t\t\t\t| [A] Pena = "<<barang.pena<<" |"<<endl;
cout<< "\t\t\t\t| [B] Buku Tulis = "<<barang.buku<<" |"<<endl;
cout<< "\t\t\t\t| [C] Kotak Pensil = "<<barang.kotak<<" |"<<endl;
cout<< "\t\t\t\t| [D] Penghapus = "<<barang.penghapus<<" |"<<endl;
cout<< "\t\t\t\t| [E] Tipe X = "<<barang.tipex<<" |"<<endl;
}
void stock_barang()
{
system("cls");
cout<<"DAFTAR STOCK BARANG"<<endl;
cout<< "\t\t\t\t================================================"<<endl;
sembako();
cout<< "\t\t\t\t================================================"<<endl;
minuman();
cout<< "\t\t\t\t================================================"<<endl;
perlengkapan();
cout<< "\t\t\t\t================================================"<<endl;
makanan_ringan();
cout<< "\t\t\t\t================================================"<<endl;
alat_tulis();
cout<< "\t\t\t\t================================================"<<endl;
char kembali;
cout<<"\t\t\t Kembali Ke Menu [Y/T] ? ";
cin>>kembali;
if(kembali=='y')
{
menu();
}else
{
system("exit");;
}
}
void distributor()
{
int pilih;
system("cls");
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>daftar distributor<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(25,6);cout<< "| 1. PT P ";gotoxy(70,6);cout<<"|"<<endl;
gotoxy(25,7);cout<< "| 2. PT Q ";gotoxy(70,7);cout<<"|"<<endl;
gotoxy(25,8);cout<< "| 3. PT R ";gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| 4. PT S ";gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| 5. PT T ";gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<<"=============================================="<<endl<<endl;
cout<< "\t\t\t Pilih distributor ";
cout<< "tekan (1/2/3/4/5) : ";cin>>pilih;
switch (pilih)
{
case 1:
system("cls");
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>PT P<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(50,6);cout<<"Beli Jual";
gotoxy(25,7);cout<<"=============================================="<<endl;
gotoxy(25,8);cout<< "| [1] Beras";gotoxy(50,8);cout<<barang.bberas;gotoxy(60,8);cout<<barang.hberas;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [2] Gula";gotoxy(50,9);cout<<barang.bgula;gotoxy(60,9);cout<<barang.hgula;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [3] Minyak Goreng";gotoxy(50,10);cout<<barang.bminyak;gotoxy(60,10);cout<<barang.hminyak;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<< "| [4] Tepung";gotoxy(50,11);cout<<barang.btepung;gotoxy(60,11);cout<<barang.htepung;gotoxy(70,11);cout<<"|"<<endl;
gotoxy(25,12);cout<< "| [5] Telur";gotoxy(50,12);cout<<barang.btelur;gotoxy(60,12);cout<<barang.htelur;gotoxy(70,12);cout<<"|"<<endl;
gotoxy(25,13);cout<<"=============================================="<<endl;
break;
case 2:
system("cls");
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>PT Q<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(50,6);cout<<"Beli Jual";
gotoxy(25,7);cout<<"=============================================="<<endl;
gotoxy(25,8);cout<< "| [1] Pena";gotoxy(50,8);cout<<barang.bpena;gotoxy(60,8);cout<<barang.hpena;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [2] Buku Tulis";gotoxy(50,9);cout<<barang.bbuku;gotoxy(60,9);cout<<barang.hbuku;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [3] Penghapus ";gotoxy(50,10);cout<<barang.bpenghapus;gotoxy(60,10);cout<<barang.hpenghapus;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<< "| [4] Kotak Pensil ";gotoxy(50,11);cout<<barang.bkotak;gotoxy(60,11);cout<<barang.hkotak;gotoxy(70,11);cout<<"|"<<endl;
gotoxy(25,12);cout<< "| [5] Tipe X ";gotoxy(50,12);cout<<barang.btipex;gotoxy(60,12);cout<<barang.htipex;gotoxy(70,12);cout<<"|"<<endl;
gotoxy(25,13);cout<<"=============================================="<<endl;
break;
case 3:
system("cls");
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>PT R<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(50,6);cout<<"Beli Jual";
gotoxy(25,7);cout<<"=============================================="<<endl;
gotoxy(25,8);cout<< "| [1] Mie Instan ";gotoxy(50,8);cout<<barang.bmie;gotoxy(60,8);cout<<barang.hmie;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [2] Roti";gotoxy(50,9);cout<<barang.broti;gotoxy(60,9);cout<<barang.hroti;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [3] Biskuit ";gotoxy(50,10);cout<<barang.bbiskuit;gotoxy(60,10);cout<<barang.hbiskuit;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<< "| [4] Wafer ";gotoxy(50,11);cout<<barang.bwafer;gotoxy(60,11);cout<<barang.hwafer;gotoxy(70,11);cout<<"|"<<endl;
gotoxy(25,12);cout<< "| [5] Kecap ";gotoxy(50,12);cout<<barang.bkecap;gotoxy(60,12);cout<<barang.hkecap;gotoxy(70,12);cout<<"|"<<endl;
gotoxy(25,13);cout<<"=============================================="<<endl;
break;
case 4:
system("cls");
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>PT S<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(50,6);cout<<"Beli Jual";
gotoxy(25,7);cout<<"=============================================="<<endl;
gotoxy(25,8);cout<< "| [1] Sabun Mandi ";gotoxy(50,8);cout<<barang.bsabun;gotoxy(60,8);cout<<barang.hsabun;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [2] Shampo";gotoxy(50,9);cout<<barang.bsampo;gotoxy(60,9);cout<<barang.hsampo;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [3] Deterjen ";gotoxy(50,10);cout<<barang.bdeterjen;gotoxy(60,10);cout<<barang.hdeterjen;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<< "| [4] Pewangi Pakaian ";gotoxy(50,11);cout<<barang.bpewangi;gotoxy(60,11);cout<<barang.hpewangi;gotoxy(70,11);cout<<"|"<<endl;
gotoxy(25,12);cout<< "| [5] Pasta Gigi ";gotoxy(50,12);cout<<barang.bpasta;gotoxy(60,12);cout<<barang.hpasta;gotoxy(70,12);cout<<"|"<<endl;
gotoxy(25,13);cout<<"=============================================="<<endl;
break;
case 5:
system("cls");
gotoxy(25,3);cout<<"=============================================="<<endl;
gotoxy(25,4);cout<<"|";gotoxy(40,4);cout<< ">>PT T<<";gotoxy(70,4);cout<<"|"<<endl;
gotoxy(25,5);cout<<"=============================================="<<endl;
gotoxy(50,6);cout<<"Beli Jual";
gotoxy(25,7);cout<<"=============================================="<<endl;
gotoxy(25,8);cout<< "| [1] Sirup ";gotoxy(50,8);cout<<barang.bsirup;gotoxy(60,8);cout<<barang.hsirup;gotoxy(70,8);cout<<"|"<<endl;
gotoxy(25,9);cout<< "| [2] Aqua ";gotoxy(50,9);cout<<barang.baqua;gotoxy(60,9);cout<<barang.haqua;gotoxy(70,9);cout<<"|"<<endl;
gotoxy(25,10);cout<< "| [3] Pocari Sweat ";gotoxy(50,10);cout<<barang.bpocari;gotoxy(60,10);cout<<barang.hpocari;gotoxy(70,10);cout<<"|"<<endl;
gotoxy(25,11);cout<< "| [4] Teh Kotak ";gotoxy(50,11);cout<<barang.bteh;gotoxy(60,11);cout<<barang.hteh;gotoxy(70,11);cout<<"|"<<endl;
gotoxy(25,12);cout<< "| [5] Minuman Bersoda ";gotoxy(50,12);cout<<barang.bsoda;gotoxy(60,12);cout<<barang.hsoda;gotoxy(70,12);cout<<"|"<<endl;
gotoxy(25,13);cout<<"=============================================="<<endl;
break;
default:
menu();
break;
}
char kembali;
cout<<"\n Kembali Ke Menu [Y/T] ? ";
cin>>kembali;
if(kembali=='y')
{
distributor();
}else
{
menu();
}
}
void transaksi()
{
system("cls");
int jumbar,pilihjenis,bayar=0,diskon=0,jumlahbayar=0,total=0,jumlahbeli[20],hargabarang[20],hargasatuanbarang[20];
char kembali,pilihsembako,pilihminuman,pilihperlengkapan,pilihmakanan,pilihalattulis;
string jumlahdiskon;
gotoxy(22,0);cout<<"===================Data Transaksi==================="<<endl;
cout<<"\n\n Berapa Banyak barang yang dibeli = ";
cin>>jumbar;
system("cls");
for (int x=1; x<=jumbar; x++){
gotoxy(22,0);cout<<"===================Data Transaksi==================="<<endl<<endl<<endl;
jenisbarang();
cout<<"\n\n Pilih Jenis Barang "<<x<<" = ";
cin>>pilihjenis;
if(pilihjenis==1){
satu :
system("cls");
hargasembako();
cout<<"\n\n Kode Sembako yang di pilih = ";
cin>>pilihsembako;
if(pilihsembako=='a'||pilihsembako=='A'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Beras";
hargasatuanbarang[x]=barang.hberas;
hargabarang[x]=barang.hberas*jumlahbeli[x];
barang.beras=barang.beras-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.uberas);
}
else if(pilihsembako=='b'||pilihsembako=='B'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Gula";
hargasatuanbarang[x]=barang.hgula;
hargabarang[x]=barang.hgula*jumlahbeli[x];
barang.gula=barang.gula-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.ugula);
}
else if(pilihsembako=='c'||pilihsembako=='C'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Minyak Goreng";
hargasatuanbarang[x]=barang.hminyak;
hargabarang[x]=barang.hminyak*jumlahbeli[x];
barang.minyak=barang.minyak-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.uminyak);
}
else if(pilihsembako=='d'||pilihsembako=='D'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Tepung";
hargasatuanbarang[x]=barang.htepung;
hargabarang[x]=barang.htepung*jumlahbeli[x];
barang.tepung=barang.tepung-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.utepung);
}
else if(pilihsembako=='e'||pilihsembako=='E'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Telur";
hargasatuanbarang[x]=barang.htelur;
hargabarang[x]=barang.htelur*jumlahbeli[x];
barang.telur=barang.telur-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.utelur);
}
else
{
cout<< "maaf anda salah memasukkan kode "<<endl;
cout<< "Silahkan Masukan kode dengan benar"<<endl;
goto satu;
}
}
if(pilihjenis==2){
dua :
system("cls");
hargaminuman();
cout<<"\n\n Kode Minuman yang di pilih = ";
cin>>pilihminuman;
if(pilihminuman=='a'||pilihminuman=='A'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Sirup";
hargasatuanbarang[x]=barang.hsirup;
hargabarang[x]=barang.hsirup*jumlahbeli[x];
barang.sirup=barang.sirup-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.usirup);
}
else if(pilihminuman=='b'||pilihminuman=='B'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Aqua";
hargasatuanbarang[x]=barang.haqua;
hargabarang[x]=barang.haqua*jumlahbeli[x];
barang.aqua=barang.aqua-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.uaqua);
}
else if(pilihminuman=='c'||pilihminuman=='C'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Pocari Sweat";
hargasatuanbarang[x]=barang.hpocari;
hargabarang[x]=barang.hpocari*jumlahbeli[x];
barang.pocari=barang.pocari-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.upocari);
}
else if(pilihminuman=='d'||pilihminuman=='D'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Teh Kotak";
hargasatuanbarang[x]=barang.hteh;
hargabarang[x]=barang.hteh*jumlahbeli[x];
barang.teh=barang.teh-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.uteh);
}
else if(pilihminuman=='e'||pilihminuman=='E'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Minuman Bersoda";
hargasatuanbarang[x]=barang.hsoda;
hargabarang[x]=barang.hsoda*jumlahbeli[x];
barang.soda=barang.soda-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.usoda);
}
else
{
cout<< "maaf anda salah memasukkan kode "<<endl;
cout<< "Silahkan Masukan kode dengan benar"<<endl;
goto dua;
}
}
else if(pilihjenis==3){
tiga :
system("cls");
hargaperlengkapan();
cout<<"\n\n Kode Perlengkapan yang di pilih = ";
cin>>pilihperlengkapan;
if(pilihperlengkapan=='a'||pilihperlengkapan=='A'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Sabun Mandi";
hargasatuanbarang[x]=barang.hsabun;
hargabarang[x]=barang.hsabun*jumlahbeli[x];
barang.sabun=barang.sabun-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.usabun);
}
else if(pilihperlengkapan=='b'||pilihperlengkapan=='B'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Shampo";
hargasatuanbarang[x]=barang.hsampo;
hargabarang[x]=barang.hsampo*jumlahbeli[x];
barang.sampo=barang.sampo-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.usampo);
}
else if(pilihperlengkapan=='c'||pilihperlengkapan=='C'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Deterjen";
hargasatuanbarang[x]=barang.hdeterjen;
hargabarang[x]=barang.hdeterjen*jumlahbeli[x];
barang.deterjen=barang.deterjen-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.udeterjen);
}
else if(pilihperlengkapan=='d'||pilihperlengkapan=='D'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Pewangi Pakaian";
hargasatuanbarang[x]=barang.hpewangi;
hargabarang[x]=barang.hpewangi*jumlahbeli[x];
barang.pewangi=barang.pewangi-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.upewangi);
}
else if(pilihperlengkapan=='e'||pilihperlengkapan=='E'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Pasta Gigi";
hargasatuanbarang[x]=barang.hpasta;
hargabarang[x]=barang.hpasta*jumlahbeli[x];
barang.pasta=barang.pasta-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.upasta);
}
else
{
cout<< "maaf anda salah memasukkan kode "<<endl;
cout<< "Silahkan Masukan kode dengan benar"<<endl;
goto tiga;
}
}
else if(pilihjenis==4){
empat :
system("cls");
hargamakanan_ringan();
cout<<"\n\n Kode Makanan Ringan yang di pilih = ";
cin>>pilihmakanan;
if(pilihmakanan=='a'||pilihmakanan=='A'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Mie Instan";
hargasatuanbarang[x]=barang.hmie;
hargabarang[x]=barang.hmie*jumlahbeli[x];
barang.mie=barang.mie-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.umie);
}
else if(pilihmakanan=='b'||pilihmakanan=='B'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Roti";
hargasatuanbarang[x]=barang.hroti;
hargabarang[x]=barang.hroti*jumlahbeli[x];
barang.roti=barang.roti-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.uroti);
}
else if(pilihmakanan=='c'||pilihmakanan=='C'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Biskuit";
hargasatuanbarang[x]=barang.hbiskuit;
hargabarang[x]=barang.hbiskuit*jumlahbeli[x];
barang.biskuit=barang.biskuit-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.ubiskuit);
}
else if(pilihmakanan=='d'||pilihmakanan=='D'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Wafer";
hargasatuanbarang[x]=barang.hwafer;
hargabarang[x]=barang.hwafer*jumlahbeli[x];
barang.wafer=barang.wafer-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.uwafer);
}
else if(pilihmakanan=='e'||pilihmakanan=='E'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Kecap";
hargasatuanbarang[x]=barang.hkecap;
hargabarang[x]=barang.hkecap*jumlahbeli[x];
barang.kecap=barang.kecap-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.ukecap);
}
else
{
cout<< "maaf anda salah memasukkan kode "<<endl;
cout<< "Silahkan Masukan kode dengan benar"<<endl;
goto empat;
}
}
else if(pilihjenis==5){
lima :\
system("cls");
hargaalat_tulis();
cout<<"\n\n Kode Makanan Ringan yang di pilih = ";
cin>>pilihalattulis;
if(pilihalattulis=='a'||pilihalattulis=='A'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Pena";
hargasatuanbarang[x]=barang.hpena;
hargabarang[x]=barang.hpena*jumlahbeli[x];
barang.pena=barang.pena-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.upena);
}
else if(pilihalattulis=='b'||pilihalattulis=='B'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Buku Tulis";
hargasatuanbarang[x]=barang.hbuku;
hargabarang[x]=barang.hbuku*jumlahbeli[x];
barang.buku=barang.buku-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.ubuku);
}
else if(pilihalattulis=='c'||pilihalattulis=='C'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Kotak Pensil";
hargasatuanbarang[x]=barang.hkotak;
hargabarang[x]=barang.hkotak*jumlahbeli[x];
barang.kotak=barang.kotak-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.ukotak);
}
else if(pilihalattulis=='d'||pilihalattulis=='D'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Pengahapus";
hargasatuanbarang[x]=barang.hpenghapus;
hargabarang[x]=barang.hpenghapus*jumlahbeli[x];
barang.penghapus=barang.penghapus-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.upenghapus);
}
else if(pilihalattulis=='e'||pilihalattulis=='E'){
cout<<" Masukkan jumlah = ";
cin>>jumlahbeli[x];
penjualan.namabarang[x]="Tipe X";
hargasatuanbarang[x]=barang.htipex;
hargabarang[x]=barang.htipex*jumlahbeli[x];
barang.tipex=barang.tipex-jumlahbeli[x];
penjualan.untung=penjualan.untung+(jumlahbeli[x]*barang.utipex);
}
else
{
cout<< "maaf anda salah memasukkan kode "<<endl;
cout<< "Silahkan Masukan kode dengan benar"<<endl;
goto lima;
}
}
system("cls");
}
gotoxy(48,1);cout<<"Barang yang di beli ";
gotoxy(20,3);cout<<"=====================================================================";
gotoxy(20,4);cout<<"| No. ";
gotoxy(25,4);cout<<"| Nama Barang ";
gotoxy(40,4);cout<<"| Harga Satuan ";
gotoxy(60,4);cout<<"| Jumlah Beli ";
gotoxy(75,4);cout<<"| Harga |";
gotoxy(20,5);cout<<"=====================================================================";
for (int y=1; y<=jumbar;y++){
gotoxy(20,y+5);cout<<"| "<<y;
gotoxy(25,y+5);cout<<"| "<<penjualan.namabarang[y];
gotoxy(40,y+5);cout<<"| "<<hargasatuanbarang[y];
gotoxy(60,y+5);cout<<"| "<<jumlahbeli[y];
gotoxy(75,y+5);cout<<"| "<<hargabarang[y];
gotoxy(88,y+5);cout<<"|";
total=total+hargabarang[y];
}
gotoxy(20,jumbar+6);cout<<"=====================================================================";
cout<<"\n\n Total Bayar = "<<total<<endl;
if(total>=250000){
diskon=total*0.1;
jumlahdiskon="10 %";
}
else if(total>=200000){
diskon=total*0.08;
jumlahdiskon="8 %";
}
else if(total>=150000){
diskon=total*0.06;
jumlahdiskon="6 %";
}
else if(total>=100000){
diskon=total*0.05;
jumlahdiskon="5 %";
}else
{
diskon=total*0;
jumlahdiskon="0 % (tidak ada diskon)";
}
jumlahbayar=total-diskon;
cout<<" Anda Mendapatkan diskon = "<<jumlahdiskon<<endl;
cout<<" Total yang harus di bayar = Rp "<<jumlahbayar<<endl;
kebayar:
cout<<" Bayar = ";
cin>>bayar;
if(bayar<jumlahbayar){
cout<<" Maaf Uang anda kurang"<<endl;
goto kebayar;
}
cout<<" Kembalian = Rp "<<bayar-jumlahbayar;
cout<<"\n TERIMAKASIH, SILAHKAN BERKUNJUNG KEMBALI "<<endl;
cout<<"\n Kembali Ke Menu [Y/T] ? ";
cin>>kembali;
if(kembali=='y')
{
menu();
}else
{
system("exit");
}
}
main ()
{
menu();
}
Lucky Club Casino Site 2021
BalasHapusLucky Club is a unique online gaming experience luckyclub.live that makes sure that you get all the details you need about your favourite slots and casino games. Rating: 4.4 · 13 reviews