``````A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected.  Write a program that asks for the month, the year, and the total amount collected at the cash register (that is, product sales plus sales tax).  The sales tax is split between the state and the county.  Assume state sales tax is 4 percent and the county sales tax is 2 percent.
If the total amount collected is known and the total sales tax is 6 percent, the amount of product sales is calculated using the formula:
S = T/1.06      where S is the product sales and T is the total income (product sales plus sales tax)
The program should display a report similar to
Month:  October
Year:      2008
---------------------------------------
Total Collected:         \$ 26572.89
Product Sales:            \$ 25068.77
County Sales Tax:     \$     501.38
State Sales Tax:         \$   1002.75
Total Sales Tax:        \$    1504.12
``````

## All 7 Replies

Start by opening the comiler's IDE. Then add `#include <iostream>`. You can continue from there.

I will give you \$5 to paypal to write this code!

We don't help people cheat on their homework assignments! Give the \$5 to a charity as a fine for asking us!

My rate is \$100 per hour.

Why sell yourself so cheap Walt? You are worth more than that! :)

He gets my sudent rate... ;o)

``````#include<iostream.h>
float s,t,ps,cs,ss,tt;
char month[25],year[6];
int main()
{
cout<<"Introduce the year :";cin>>year;cout<<'\n';
cout<<"Introduce the month :";cin>>month;cout<<'\n';
cout<<"Introduce the total ammount collected :";cin>>s;cout<<'\n';
cs=s/53;
ss=2*cs;
tt=cs+ss;
ps=s-tt;
cout<<"Month\t"<<month<<'\n';
cout<<"Year\t"<<year<<'\n';
cout<<"------------------------------\n";
cout<<"Total collected\t\t"<<"\$ "<<s<<'\n';
cout<<"Product Sales\t\t"<<"\$ "<<ps<<'\n';
cout<<"County Sales tax\t"<<"\$ "<<cs<<'\n';
cout<<"State Sales tax\t\t"<<"\$ "<<ss<<'\n';
cout<<"Total Sales tax\t\t"<<"\$ "<<tt<<'\n';
}
``````
commented: Do you get his grade now? -2
commented: I give you a C for using iostream.h and global variables, and not using strings -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.