0% found this document useful (0 votes)
4K views2 pages

Syntax C++ Program Kasir Sederhana

This C++ program is a simple cashier program for a cafeteria. It allows the user to input the code, name, quantity, and price of multiple items. It then calculates the total for each item and the grand total. The program displays the item details and totals. It also asks the user to input the amount paid by the customer and calculates the change returned.

Uploaded by

PUTU_16
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4K views2 pages

Syntax C++ Program Kasir Sederhana

This C++ program is a simple cashier program for a cafeteria. It allows the user to input the code, name, quantity, and price of multiple items. It then calculates the total for each item and the grand total. The program displays the item details and totals. It also asks the user to input the amount paid by the customer and calculates the change returned.

Uploaded by

PUTU_16
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

syntax C++ program kasir sederhana

#include
#include
#include
#include
using namespace std;
void main() {
struct kantin {
string kode;
string nama;
int jumlah;
int harga;
int total;
int grand;

};
int i,j,n,m,x,y,byr,kmbl,grand;
kantin dathitung[10];
clrscr();
cout<<"====================================="<< div="">
cout<<" Program Hitung Kantin "<< div="">
cout<<" STMIK ROSMA "<< div="">
cout<<" Createad by Heri Herdiansah"<< div="">
cout<<" 200801151014"<< div="">
cout<<"====================================="<< div="">
cout<<"Masukan Jumlah Data Barang : ";cin>>n;
cout<< div="">
for(j=0;j< div="">
{ x=j+1;
cout<<"Data ke - "<<< div="">
cout<<"Kode Barang : ";cin>>dathitung[j].kode;
cout<<"Nama Barang : ";cin>>dathitung[j].nama;
cout<<"Jumlah : ";cin>>dathitung[j].jumlah;
cout<<"Harga : ";cin>>dathitung[j].harga;
cout<<"====================================="<< div="">
dathitung[j].total=dathitung[j].harga*dathitung[j].jumlah;
}
clrscr();
cout<<"=========================================================================
====="<< div="">
cout<<" Daftar Rincian Hitung Kantin"<< div="">
cout<<" STMIK ROSMA "<< div="">
cout<<" Createad by Heri Herdiansah"<< div="">
cout<<" 200801151014"<< div="">
cout<<"=========================================================================
======"<< div="">
cout <<>
cout <<>
cout <<>
cout <<>
cout<<"-------------------------------------------------------------------------
-------"<< div="">
for(i = 0; i < y="">cout <<<<>
<<>
<<>
<<>
<<>
grand= grand+dathitung[i].total;
}
cout<<"-------------------------------------------------------------------------
-------"<< div="">
cout<< "Grand Total Pembelian : "<<< div="">
cout<< "jumlah Bayar: ";cin>>byr;
kmbl=byr-grand;
cout<< "jumlah Kembali: "<< div="">
cout<<< div="">
cout<<" Terima Kasih"<< div="">
getch();
}
<>
<<>
<>
<<>
<>
<<<>
<>
<>
<>
<>
<>
<>
<>
<>
<<>
<>
<>
<>
<>
<>
<>
<>
<>

You might also like