Can anyone show me this program for C++. I am not very good at programming.

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.
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.
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
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
Topic archived. No new replies allowed.