Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program Toko Buku
- // Task No.1 file 066-P04B.pptx
- // Amrul Mubarak Harahap
- // 19T03 - 1901098
- #include <iostream>
- #include <string>
- #include <cstring>
- using namespace std;
- int main(){
- int kode, jumlahP, hargaB, potongan, total, ppn;
- string namaB, bonus;
- char ulang;
- cout << "Masukkan Kode Buku [1/2/3]: ";
- cin >> kode;
- cout << "Jumlah Pembelian Buku Anda: ";
- cin >> jumlahP;
- menu:
- system("cls");
- cout << "\t\t\t***TOKO BUKU AMRUL***" << endl;
- cout << "\t\t\t Jl. Kebebasan No.9" << endl;
- cout << "-------------------------------------------------------------" << endl;
- switch (kode){
- case 1 :
- namaB = "Sukses Belajar Bahasa C++";
- hargaB = 50000;
- if(jumlahP > 5){
- potongan = jumlahP * ((10*hargaB)/100);
- bonus = "Note Book";
- } else {
- potongan = 0;
- bonus = "Maaf, Anda tidak mendapat bonus";
- }
- total = (jumlahP * hargaB) - potongan;
- ppn = (10*total)/100;
- break;
- case 2 :
- namaB = "Kunci Pribadi Untuk Sukses";
- hargaB = 35000;
- if(jumlahP > 5){
- potongan = jumlahP * ((10*hargaB)/100);
- bonus = "Note Book";
- } else {
- potongan = 0;
- bonus = "Maaf, Anda tidak mendapat bonus";
- }
- total = (jumlahP * hargaB) - potongan;
- ppn = (10*total)/100;
- break;
- case 3 :
- namaB = "Mencari Mutiara di Dasar Hati";
- hargaB = 45000;
- if(jumlahP > 5){
- potongan = jumlahP * ((10*hargaB)/100);
- bonus = "Note Book";
- } else {
- potongan = 0;
- bonus = "Maaf, Anda tidak mendapat bonus";
- }
- total = (jumlahP * hargaB) - potongan;
- ppn = (10*total)/100;
- }
- cout << "Nama Buku : " << namaB << endl;
- cout << "Harga Buku : Rp" << hargaB << endl;
- cout << "Potongan : Rp" << potongan << endl;
- cout << "Bonus : " << bonus << endl;
- cout << "Total Bayar : Rp" << total << endl;
- cout << "PPN : " << ppn << endl;
- cout << "\n\t\t\t***TERIMAKASIH***" << endl;
- cout << "\n\t\tApakah mau menginput lagi?(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