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
#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;
}
Comments
Leave a comment