#include <iostream>
using namespace std ;
int main() {
//Variables
char country;
int taxed ;
float pay ;
char uk_tax = 'a'; //40%
char us_tax ='b';//mulitple by number devide answer by 100
//Inputs
cout << "Enter your total earnings: ";
cin >> pay ;
cout << "Are you within the UK or USA?\n ";
cout << "a) For Uk b) For USA \n ";
cin >> country ;
switch(country)
{
case 1:
//chosen if input is a
if (country == uk_tax )
taxed = 40 * pay / 100;
cout<< "Here are your earnings after Tax £" << taxed ;
break;
case 2:
//chosen if input is b
if (country == us_tax)
taxed = 28 * pay / 100 ;
cout << "Here are your earning after Tax £" << taxed ;
break;
} return 0 }
hello i was just wondering if anyone could help see the problem i'm having with this code. The code does not execute the switch statements.The code its self it just a tax calculator for two country (usa,uk) the user picks the country by entering 'a' or 'b' but i can't seem to get it to execute the switch statements after
country
isn't 1 or 2?'a'
and'b'
not1
and2
.'a'
and'b'
, actually.if
cases within theswitch
itself.