Sales tax programming help?!

closed account (jLA4LyTq)
Write a C++ program that will compute the total sales tax on a $95 purchase. Assume the state sales tax is 6% and the county sales tax is 2%. You only have to output the total sales tax. You should not output any text nor should to output the $. Make sure you end your output with the endl or "/n" new line character. You must calculate the total taxes in the program, and then output them. Do not calculate them outside of the program.
Okay so i only understand like half of what's going on. Could someone help me get started. i have four similar programs like this i have to do so i kinda want to see an example so ill be able to do the rest. thank you so much in advance!
Last edited on
closed account (48T7M4Gy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

using namespace std;

int main()
{
    double purchase = 95.00;
    ... total _sales_tax = ...

    ...

    cout << total ... endl;

    return 0;
}
For a simple program like this you can follow the IPO principle ( input-process-output).
Input
purchase ->$95
state tax -> 6%
county tax -> 2%
Processing
state tax = purchase * 6 / 100
county tax = purchase * 2 / 100
total tax = state tax + county tax
Output
The total tax is....
Topic archived. No new replies allowed.