Answer to Question #250984 in C++ for ynwbslime

Question #250984

given the value added tax is 15% of the cost of a product ,design an interface and write a program that accepts any cost of a product and calculates the value added tax given output


1
Expert's answer
2021-10-13T20:36:04-0400
#include <iostream>
using namespace std;
int main(){
    float vat = 0.15, cost;
    int choice = 2;
    do{
        cout<<"1. Input cost to calculate vat\n";
        cout<<"2. Exit\n";
        cin>>choice;
        switch(choice){
            case 1: cout<<"Input cost: "; cin>>cost;
                    cout<<"VAT = "<<vat * cost<<endl; break;
            default: break;
        }
    }while(choice == 1);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS