0% found this document useful (0 votes)
126 views4 pages

Contoh Materi Program Kasir

The document contains code for two cash register programs. The first program allows a user to input product names, prices, and quantities and calculates subtotals, discounts, and totals. The second program is for a food stall that allows a user to select a food item, enter a quantity, and calculates the total, payment, and change returned. Both programs use loops and conditional statements to process multiple items or transactions.

Uploaded by

tri utami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views4 pages

Contoh Materi Program Kasir

The document contains code for two cash register programs. The first program allows a user to input product names, prices, and quantities and calculates subtotals, discounts, and totals. The second program is for a food stall that allows a user to select a food item, enter a quantity, and calculates the total, payment, and change returned. Both programs use loops and conditional statements to process multiple items or transactions.

Uploaded by

tri utami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Contoh program kasir

#include <iostream>
using namespace std;
main (){
string namaa="Yusron Rizki Ardiansyah";
string nim="F1B016103";
int diskon,i,j, x, total;
int bayar[10], hrga[10],jbrg[10], totali=0;
char nama[30][x];

cout<<namaa<<endl;
cout<<nim<<endl;
cout<<"==============================="<<endl;
cout<<"======== Program Kasir ========"<<endl;
cout<<"==============================="<<endl;
cout<<endl;
cout<< "Masukkan Jumlah Data = ";
cin>>x;
cout << endl;

for(i=0;i<x;i++){
cout<<"==============================="<<endl;
cout<<endl;
cout<< "Masukkan Nama Barang = ";
cin>>nama[i];
cout<< "Masukkan Harga Barang = Rp.";
cin>>hrga[i];
cout<< "Masukkan Jumlah Barang = ";
cin>>jbrg[i];
cout<<endl;
}

system("cls");
for(i=0;i<x;i++){
cout<<"Nama Barang = "<<nama[i]<<endl;
cout<<"Harga Barang = Rp. "<<hrga[i]<<endl;
cout<<"Jumlah Barang = "<<jbrg[i]<<endl;
bayar[i]=hrga[i]*jbrg[i];
cout<<"jumlah Belanja = "<<bayar[i]<<endl;
cout<<endl;
}

for(i=0; i<x; i++){


totali=totali+bayar[i];
cout<<"Sub total = "<<totali<<endl;
}
if (totali>30000){
diskon=0.1*totali;
cout<<"Diskon 10% = Rp. "<<diskon<<endl;
total=totali-diskon;
cout<<"Total = Rp. "<<total<<endl;
}
}

#include<iostream>
using namespace std;
int main (){
int kode,pri,jml,tot,byr,kbl;
char mad;
do
{
cout<<" RUMAH MAKAN "<<endl;
cout<<" NASI BALAP PUYUNG "<<endl;
cout<<" Aplikasi kasir rumah makan "<<endl;
cout<<"============================================"<<endl;
cout<<""<<endl;
cout<<"Menu Makanan Harga"<<endl;
cout<<"1. AYAM GORENG Rp. 10.000"<<endl;
cout<<"2. NASI GORENG Rp. 8.000"<<endl;
cout<<"3. MIE PANGSIT Rp. 10.000"<<endl;
cout<<"4. NASI BALAP PUYUNG Rp. 12.000"<<endl;
cout<<"5. NASI CAMPUR Rp. 8.000"<<endl;
cout<<"6. JUS JERUK Rp. 6.000"<<endl;
cout<<"7. AIR GELAS Rp. 500"<<endl;
cout<<'n'<<"MASUKKAN PILIHAN ANDA :";
cin>>kode;
switch (kode){
case 1:
cout<<'n'<<"AYAM GORENG"<<endl;
pri=10000;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
case 2:
cout<<'n'<<"NASI GORENG"<<endl;
pri=8000;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
case 3:
cout<<'n'<<"MIE PANGSIT"<<endl;
pri=10000;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
case 4:
cout<<'n'<<"NASI BALAP PUYUNG"<<endl;
pri=12000;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
case 5:
cout<<'n'<<"NASI CAMPUR"<<endl;
pri=8000;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
case 6:
cout<<'n'<<"JUS JERUK"<<endl;
pri=6000;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
case 7:
cout<<'n'<<"AIR GELAS"<<endl;
pri=500;
cout<<"Masukkan Jumlah :";
cin>>jml;
tot=pri*jml;
cout<<"Total harganya yaitu : Rp. "<<tot<<endl;
cout<<"DIBAYAR : Rp. ";
cin>>byr;
kbl=byr-tot;
cout<<"KEMBALI : Rp. "<<kbl<<endl;
cout<<"Masih ada Y/T :";
cin>>mad;
break;
default:
cout<<"Kode yang anda masukkan tidak ada";
}
}
while (mad/='Y');
cout<<"Terimah Kasih Atas Kunjungan Anda WARUNG NASI BALAP PUYUNG";
return 0;
}

You might also like