Question

In: Computer Science

Monthly Sales Tax Program A retail company must file a monthly sales tax report listing the...

Monthly Sales Tax Program

A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the total sales for the month. The application should calculate and display the amount of county sales tax, the amount of state sales tax, and the total sales tax.

Your program must use the following functions, no more, no less and all variables must be local variables

main() – Calls all the other functions inputTotalSales() – Asks the user for total sales for the month calculateTaxes() – Calculates the State and County sales tax displayTaxes() – Displays the taxes

i want the program to work, but i need one error in the program.

Solutions

Expert Solution

C Code:-

#include<stdio.h>
#include<conio.h>

//Function definition
void inputTotalSales(double* sales)
{
printf("Enter total sales: ");
scanf("%lf", sales);
}
void calculateTaxes(double* stateTax, double* countryTax, double sales)
{
*stateTax = sales * 0.05;//calculation is wrong it should be 0.04.(has put this as per your request.)
*countryTax = sales * 0.02;
}
void displayTaxes(double stateTax, double countryTax)
{
printf("State sale tax: %.2lf\nCountry sales tax: %.2lf\nTotal sales tax: %.2lf\n"
, stateTax, countryTax, (stateTax + countryTax));
}

//main functions
int main()
{
double sales, stateTax, countryTax;
//calling the functions
inputTotalSales(&sales);
calculateTaxes(&stateTax, &countryTax, sales);
displayTaxes(stateTax, countryTax);
}

Output:-

Screenshot of Code:-

As u have not mentioned any programming language i did it in c .

if u like my answer then please give a thumbs up..!!


Related Solutions

Monthly Sales Tax A retail company must file a monthly sales tax report listing the total...
Monthly Sales Tax A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 5 percent and the county sales tax rate is 2.5 percent. Write a Python program with function(s) that asks the user to enter the total sales for the month. Make sure that you do not allow user to enter negative values for the total...
A retail company must file a monthly sales tax report listing the total sales for the...
A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4% and the county sales tax rate is 2%. Create an application that allows the user to enter the total sales from the month. From this figure, the application should calculate and display the following: 1. The amount of country sales tax 2. The amount of state...
A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected.
make it in C++ with pointerA retail company must file a monthly sales tax report listing the sales for the month andthe 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, sales plus sales tax). Assumethe 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,...
A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected.
Must be done in Visual StudiosA 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, sales plus sales tax). Assume the 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...
A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected.
A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 5 percent and the county sales tax rate is 3 percent. Create a GUI application that allows the user to enter the total sales for the month into a text field. From this figure, the application should calculate and display the following: The number of county sales tax...
A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected.
C programming Monthly Sales Tax Program A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the total sales for the month. The application should calculate and display the amount of county sales tax, the amount of...
Winfield Company operates a retail store a) Below is a table containing monthly sales and sales...
Winfield Company operates a retail store a) Below is a table containing monthly sales and sales staff compensation, in dollars for the previous year. Use the high-low method to create an equation in the form Y = a+ bX to describe the behavior of sales staff compensation. Month Comp Sales 1 412,700 1,808,000 2 386,000 1,659,000 3 359,700 1,512,000 4 346,500 1,138,000 5 359,400 1,218,900 6 341,000 1,233,000 7 366,500 1,409,300 8 364,200 1,437,000 9 400,100 1,616,600 10 443,000 1,833,000...
Write a C++ program that creates a file called Readings.txt. Inside the file, your program must...
Write a C++ program that creates a file called Readings.txt. Inside the file, your program must create a list. The list is composed of integer double pairs. There is one pair per line. The integers are in sequence (0, 1, 2, 3, ...) beginning with zero and ending with some random value between 512 and 1024. The doubles should be random values between 50.000 and 90.000. The doubles only have 3 decimal places. The file should look like this (of...
Stine Co. is a retail store operating in a state with a 6% retail sales tax.
Stine Co. is a retail store operating in a state with a 6% retail sales tax. The retailer may keep 2% of the sales tax collected. Stine Co. records the sales tax in the Sales account. The amountrecorded in the Sales account during May was $148,400. 99. The amount of sales taxes (to the nearest dollar) for May isa. $8,726. b. $8,400. c. $8,904. d. $9,438.The amount of sales taxes payable (to the nearest dollar) to the state for the...
Vaughn Co. is a retail store operating in a state with a 7% retail sales tax....
Vaughn Co. is a retail store operating in a state with a 7% retail sales tax. The retailer may keep 2% of the sales tax collected. Vaughn Co. records the sales tax in the Sales Revenue account. The amount recorded in the Sales Revenue account during May was $747930. The amount of sales taxes payable (to the nearest dollar) to the state for the month of May is $37307. $47951. $51310. $61874.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT