program c++ kasir sederhana
#include "conio.h"
#i nclude "iostream.h"
#include "stdio.h"
main()
{
struct
{
char kosir[3], nasir[30], pasword[7];
}ksr;
struct
{
char kobar, nabar[20];
int harga, jumli, total, bayar, kembali;
}brng;
char awal, ulang;
awal:
clrscr();
puts("----------------------------------------------");
puts("* PROGRAM PENJUALAN SEPATU PADA MATAHARI *");
puts("----------------------------------------------");
puts("[1] Input Kasir");
puts("[2] Input Barang");
puts("[3] Exit");
cout<<"Pilih Kode Menu [1/2/3] : ";cin>>awal;
if (awal=='1')
goto satu;
else
if (awal=='2')
goto dua;
else
goto tiga;
satu:
clrscr();
puts("----------------------------------------------");
puts("* FORM KASIR *");
puts("----------------------------------------------");
cout<<"Kode Kasir [BDM/ASS/RNI] : ";gets(ksr.kosir);
if ((!strcmp (ksr.kosir, "BDM"))||(!strcmp (ksr.kosir, "bdm")))
{strcpy (ksr.nasir, "Budi Mustofa");}
else
if ((!strcmp (ksr.kosir, "ASS"))||(!strcmp (ksr.kosir, "ass")))
{strcpy (ksr.nasir, "Asep Setiawan");}
else
{strcpy (ksr.nasir, "Rini Indriani");}
cout<<"Nama Kasir : "< cout<<"Password : ";gets(ksr.pasword);
if (!strcmp (ksr.pasword, "123456"))
{cout<<"Password Benar"< else
{cout<<"Maaf, Password Salah"< goto tiga;}
puts("----------------------------------------------");
cout<<"Mau input lagi [Y/T] : ";cin>>ulang;
if (ulang=='Y'||ulang=='y')
goto satu;
else
goto awal;
dua:
clrscr();
puts("----------------------------------------------");
puts("* FORM BARANG *");
puts("----------------------------------------------");
puts("[A] Bata");
puts("[B] Nevada");
puts("[C] Homyped");
cout<<"Kode Barang [A/B/C] : ";cin>>brng.kobar;
if (brng.kobar=='A'||brng.kobar=='a')
{strcpy (brng.nabar, "Bata");
brng.harga=90000;}
else
if (brng.kobar=='B'||brng.kobar=='b')
{strcpy (brng.nabar, "Nevada");
brng.harga=100000;}
else
{strcpy (brng.nabar, "Homyped");
brng.harga=150000;}
puts("----------------------------------------------");
cout<<"Nama Barang : "< cout<<"Harga Barang : Rp. "< cout<<"Jumlah Beli : ";cin>>brng.jumli;
brng.total=brng.harga*brng.jumli;
cout<<"Total Bayar : Rp. "< cout<<"Uang Bayar : Rp. ";cin>>brng.bayar;
brng.kembali=brng.bayar-brng.total;
cout<<"Uang Kembali : Rp. "< puts("----------------------------------------------");
cout<<"Transaksi lagi [Y/T] : ";cin>>ulang;
if (ulang=='Y'||ulang=='y')
goto dua;
else
goto awal;
tiga:
cout< cout<<"***** TERIMA KASIH *****";
getch();
}
#i nclude "iostream.h"
#include "stdio.h"
main()
{
struct
{
char kosir[3], nasir[30], pasword[7];
}ksr;
struct
{
char kobar, nabar[20];
int harga, jumli, total, bayar, kembali;
}brng;
char awal, ulang;
awal:
clrscr();
puts("----------------------------------------------");
puts("* PROGRAM PENJUALAN SEPATU PADA MATAHARI *");
puts("----------------------------------------------");
puts("[1] Input Kasir");
puts("[2] Input Barang");
puts("[3] Exit");
cout<<"Pilih Kode Menu [1/2/3] : ";cin>>awal;
if (awal=='1')
goto satu;
else
if (awal=='2')
goto dua;
else
goto tiga;
satu:
clrscr();
puts("----------------------------------------------");
puts("* FORM KASIR *");
puts("----------------------------------------------");
cout<<"Kode Kasir [BDM/ASS/RNI] : ";gets(ksr.kosir);
if ((!strcmp (ksr.kosir, "BDM"))||(!strcmp (ksr.kosir, "bdm")))
{strcpy (ksr.nasir, "Budi Mustofa");}
else
if ((!strcmp (ksr.kosir, "ASS"))||(!strcmp (ksr.kosir, "ass")))
{strcpy (ksr.nasir, "Asep Setiawan");}
else
{strcpy (ksr.nasir, "Rini Indriani");}
cout<<"Nama Kasir : "<
if (!strcmp (ksr.pasword, "123456"))
{cout<<"Password Benar"<
{cout<<"Maaf, Password Salah"<
puts("----------------------------------------------");
cout<<"Mau input lagi [Y/T] : ";cin>>ulang;
if (ulang=='Y'||ulang=='y')
goto satu;
else
goto awal;
dua:
clrscr();
puts("----------------------------------------------");
puts("* FORM BARANG *");
puts("----------------------------------------------");
puts("[A] Bata");
puts("[B] Nevada");
puts("[C] Homyped");
cout<<"Kode Barang [A/B/C] : ";cin>>brng.kobar;
if (brng.kobar=='A'||brng.kobar=='a')
{strcpy (brng.nabar, "Bata");
brng.harga=90000;}
else
if (brng.kobar=='B'||brng.kobar=='b')
{strcpy (brng.nabar, "Nevada");
brng.harga=100000;}
else
{strcpy (brng.nabar, "Homyped");
brng.harga=150000;}
puts("----------------------------------------------");
cout<<"Nama Barang : "<
brng.total=brng.harga*brng.jumli;
cout<<"Total Bayar : Rp. "<
brng.kembali=brng.bayar-brng.total;
cout<<"Uang Kembali : Rp. "<
cout<<"Transaksi lagi [Y/T] : ";cin>>ulang;
if (ulang=='Y'||ulang=='y')
goto dua;
else
goto awal;
tiga:
cout<
getch();
}
Sukses ilmunya gan Software Toko
BalasHapus