Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program Gerobak Fried Chicken
- // Task file 066-P06.pptx
- // Amrul Mubarak Harahap
- // 19T03 - 1901098
- #include <iostream>
- #include <cstring>
- #include <string>
- using namespace std;
- int main(){
- int x;
- long harga[6] = {2500, 2000, 1500}, banyakPtg[6], jumlahHrg[6] = {0},
- jumlahByr[6] = {0}, pajak[6], total[6];
- char kode[6] = {'D','d', 'P', 'p', 'S', 's'}, ulang;
- string jenis[6];
- menu:
- system("cls");
- cout << "Gerobak Fried Chicken" << endl;
- cout << "=======================" << endl;
- cout << "Kode Jenis Harga" << endl;
- cout << "=======================" << endl;
- cout << "D Dada 2500" << endl;
- cout << "P Paha 2000" << endl;
- cout << "S Sayap 1500" << endl;
- cout << "=======================" << endl;
- cout << "Banyak Pesanan: "; cin >> x;
- for(int i=0; i < x; i++){
- cout<<"\nPesanan ke-" << i+1 <<endl;
- cout << "Kode Potong [D/P/S]: "; cin >> kode[i];
- cout << "Banyak Potong : "; cin >> banyakPtg[i];
- cout<<endl;
- if(kode[i] == 'D' || kode[i] == 'd'){
- jenis[i] = "Dada";
- harga[i] = 2500;
- }
- else if(kode[i] == 'P' || kode[i] == 'p'){
- jenis[i] = "Paha";
- harga[i] = 2000;
- }
- else if(kode[i] == 'S' || kode[i] == 's'){
- jenis[i] = "Sayap";
- harga[i] = 1500;
- } else {
- cout << "Kode yang Anda masukkan tidak tersedia.";
- cout << "\n\t\t\t\tINGIN MENGULANG?(Y/T): "; cin >> ulang;
- if(ulang == 'Y' || ulang == 'y'){
- goto menu;
- } else {
- goto akhir;
- }
- }
- jumlahByr[x] += banyakPtg[i] * harga[i];
- pajak[x] = (10*jumlahByr[x])/100;
- total[x] = jumlahByr[x] + pajak[x];
- }
- cout << "==============================================" << endl;
- cout << "No. Jenis Harga Banyak Jumlah"<<endl;
- cout << " Potong Satuan Potong Harga"<<endl;
- cout << "==============================================" << endl;
- for(int i = 0; i < x; i++){
- jumlahHrg[i] = banyakPtg[i] * harga[i];
- cout << " "<< i+1 << " " << jenis[i] << " " << harga[i];
- cout << " " << banyakPtg[i] << " " << jumlahHrg[i] << endl;
- }
- cout << "==============================================" << endl;
- cout << "Jumlah Bayar : Rp" << jumlahByr[x] << endl;
- cout << "Pajak 10% : Rp" << pajak[x] << endl;
- cout << "Total Bayar : Rp" << total[x] << endl;
- cout << "\n\t\t\t\tINGIN MENGULANG?(Y/T): "; cin >> ulang;
- if(ulang == 'Y' || ulang == 'y'){
- goto menu;
- } else {
- goto akhir;
- }
- akhir:
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement