Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Khisby Al Ghofari, 06.2017.1.06852, Kelas B
- #include <iostream>
- using namespace std;
- int main()
- {
- int menu,total,discount,total_discount,after_discount,sales_tax,total_price ;
- cout << "\n==============================================\n";
- cout << "Welcome To \n";
- cout << "Application discount policy Keith's Sheet Music\n";
- cout << "================================================\n \n";
- cout << "Select menu: \n";
- cout << "1. Theacher \n";
- cout << "2. Non-Theacher \n";
- cout << "\n\nInput the number of menu : ";
- cin >> menu;
- cout << "Input total purchases : $";
- cin >> total;
- if(menu == 1){
- if(total >= 100){
- discount= 12;
- }else{
- discount= 10;
- }
- total_discount = total*discount/100;
- after_discount = total-total_discount;
- sales_tax = after_discount*5/100;
- total_price = after_discount-sales_tax;
- cout << "\n\n\Total purchases \t\t $" << total << "\n";
- cout << "Theacher's discount ("<< discount << "%) \t " << total_discount << "\n";
- cout << "Discounted total \t\t " << after_discount << "\n";
- cout << "Sales Tax (5%) \t\t\t " << sales_tax << "\n";
- cout << "Total \t\t\t\t $" << total_price << "\n\n";
- }else if(menu == 2){
- sales_tax = total*5/100;
- total_price = total-sales_tax;
- cout << "\n\nTotal purchases \t $" << total << "\n";
- cout << "Sales Tax (5%) \t\t " << sales_tax << "\n";
- cout << "Total \t\t\t $" << total_price << "\n\n";
- }else{
- cout << "Your input is invalid";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement