Hi everyone, this is my first shot at C++ and this problem is skullcrushing
i tried to fill it with
{
if (residence = O )
taxRate = 0;
else (residence = I )
taxRate = .05;
}
--------------------------------------
But the program wont compile.
here's the skeleton i have to work with
--------------------------------------
If the customer is an in-state resident, taxRate should be set to .05
If the customer is an out-of-state resident, taxRate should be set to 0.
#include <iostream>
using namespace std;
int main()
{
double taxRate, saleAmount;
char residence;
cout << "Enter the amount of the sale: ";
cin >> saleAmount;
cout << "Enter I for in-state residence or O for out-of-\n";
cout << "state: ";
cin.get(residence);
// Write code here that assigns 0 to taxRate if residence
// is set to 'O' or .05 to taxRate if residence is set
// to 'I'
saleAmount += saleAmount * taxRate;
cout << "The total is " << saleAmount;
return 0;
}
I would really appreciate your help and explanations.