Feb 29, 2012 at 2:51am UTC
Write a C++ program that will calculate the amount of taxes to charge based on whether the user lives in Ohio, Michigan, California, Texas, or New York. The user is going to initially enter the amount of money that they are going to pay for a certain product. Based on which state they live in, the amount of tax they will have to pay will be different. Use a switch in your program.
Feb 29, 2012 at 2:55am UTC
Gonna have to do some work yourself.
Start at the beginning, don't try to code the whole problem at once.
First task.
Do you know how to get user input.
Feb 29, 2012 at 3:04am UTC
This is what i have so far.
#include <iostream>
using namespace std;
int main()
{
//program that will calculate taxes based on input
(switch)
#include <iostream>
using namespace std;
int main()
{
int option;
double total, taxes, amount;
cout << "Please enter the amount you have to pay for you purchase:
"<<end1;
cin >> amount;
cout << "Please enter the state that you live in: "<< endl;
<< "Please select 1
Feb 29, 2012 at 3:07am UTC
Ok well you're missing a closing brace for the switch statement and you haven't initialized tax.
Also, for future, reference, place your code within code tags to make it easier to read.
[code] [/ code] (without the space betwween / code)
Edit; Ok you've changed your code now and it doesn't really make much sense.
Can you post the full code, contained within [code] tags. (click the <> symbol on the Format: part to the right of a new post)
Last edited on Feb 29, 2012 at 3:16am UTC