Question
Question: A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county
Question: 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. Design a modular pro- gram that asks the user to enter the total sales for the month. From this figure, the application should calculate and display the following: ? The amount of county sales tax ? The amount of state sales tax ? The total sales tax (county plus state) In the pseudocode, represent the county tax rate (0.02) and the state tax rate (0.04) as named constants.
I wrote this program in c++ it giving me following error: line 38 expected ',' or ';' before '{' token and line 49 has following error : expected unqualified-id before '{' token
//This program calculates the monthly tax sales
#include
using namespace std; //Declaring constants const double countyTax = 0.02; const double stateTax =0.04;
//Defining function prototype double gettotalSalesPerMonth(double totalSalesPerMonth); double getCountySalesTax(double totalSalesPerMonth); double getStatesalesTax (double totalSalesPerMonth); double getTotalSalesTax (double totalSalesPerMonth);
int main() { //Local variables double totalSalesPerMonth, countySalesTax, stateSalesTax, totalSalesTax;
//get total sales per month totalSalesPerMonth = gettotalSalesPerMonth(totalSalesPerMonth); countySalesTax = gettotalSalesPerMonth(countySalesTax); stateSalesTax = gettotalSalesPerMonth(stateSalesTax); totalSalesTax = gettotalSalesPerMonth(totalSalesTax);
return 0; }
// total sales tax is calculated by the input of total sales per month // state tax is calculated by the input of total monthly sales and tax rate // county sales tax is calculated by the total sales tax and tax rate
int totalSalesTax = gettotalSalesPerMonth(totalSalesTax) { int Sales; cout > Sales;
return sales; }
// show results modules calculates the state and county tax based on the sales tax. void showResults (int totalSalesPerMonth);
{ // Defining variables
int countySalesTax; int stateSalesTax ; int totalSalesTax;
// calculate the amount of county sales tax countySalesTax = totalSalesPerMonth * countyTax
//calculate the amount of state sales tax stateSalesTax = totalSalesPerMonth * stateTax
// calculate total sales tax totalSalesTax = countySalesTax + stateSalesTax
//Display the amount of county sales tax cout
//Display the amount of state sales tax cout
//Display the total sales tax cout
return 0;
}
//This program calculates the monthly tax sales
#include
using namespace std; //Declaring constants const double countyTax = 0.02; const double stateTax =0.04;
//Defining function prototype double gettotalSalesPerMonth(double totalSalesPerMonth); double getCountySalesTax(double totalSalesPerMonth); double getStatesalesTax (double totalSalesPerMonth); double getTotalSalesTax (double totalSalesPerMonth);
int main() { //Local variables double totalSalesPerMonth, countySalesTax, stateSalesTax, totalSalesTax;
//get total sales per month totalSalesPerMonth = gettotalSalesPerMonth(totalSalesPerMonth); countySalesTax = gettotalSalesPerMonth(countySalesTax); stateSalesTax = gettotalSalesPerMonth(stateSalesTax); totalSalesTax = gettotalSalesPerMonth(totalSalesTax);
return 0; }
// total sales tax is calculated by the input of total sales per month // state tax is calculated by the input of total monthly sales and tax rate // county sales tax is calculated by the total sales tax and tax rate
int totalSalesTax = gettotalSalesPerMonth(totalSalesTax) { int Sales; cout > Sales;
return sales; }
// show results modules calculates the state and county tax based on the sales tax. void showResults (int totalSalesPerMonth);
{ // Defining variables
int countySalesTax; int stateSalesTax ; int totalSalesTax;
// calculate the amount of county sales tax countySalesTax = totalSalesPerMonth * countyTax
//calculate the amount of state sales tax stateSalesTax = totalSalesPerMonth * stateTax
// calculate total sales tax totalSalesTax = countySalesTax + stateSalesTax
//Display the amount of county sales tax cout
//Display the amount of state sales tax cout
//Display the total sales tax cout
return 0;
}
File Edit View Search Project Build Debug Fortren wxSmith Tools Tools+Plugins DoxyBilocks Setings Help Start here Project3. 10.cppX Projects Symbols Fies Workspace #include using namespace std: const double countyTax aring 0,02; 10 const double stateTax-.04 12 13 unct double gettotalSales PerMonth (double totalSalesPerHonth) donble getcountysalesTax (double totalsalesPerMonth) double getstatesaleaTax double totalsalesPerMonth) double getTotalSalesTax (double total8alesPerMonth 15 16 17 18 int main 20 21 doable total5alesPerMonth, countysalesTax, statesalesTax, totalSalesTax 23 24 25 ales per month totalSalesPerNonth -gettotalSalesPerMonth (totalSalesPerMonth ; countysalesTaxgettotaiSalesPerHonth (countysalesTax) 27 28 29 totalSalesTax -gestotalSalesPerMonth (totalSalesTax) return Logs& others Acode:aodes |-4search results xlAcccc x Buld log | Build messages xlA Cocc X Line Hessage -Basid file: "no targ:" in "no Project. (compiler: unknown)-- C:UsersJanar..4Sxpected unqunlifsed-id before' token 1 19WeekProjectProject3-10.cpp Windows (CR+LF) WINDOWS-1252 Line 18, Col 11, Pos 450 Insert Read/Write default 12:53 PM Type here to search 21 12119 File Edit View Search Project Build Debug Fortren wxSmith Tools Tools+Plugins DoxyBilocks Setings Help Start here Project3. 10.cppX Projects Symbos Fies 32 Workspace tal 52, 1 e per month cal monthly salea and cax rate 34 35 Lated by the county sales tax 1 calculated by the total sales tax and tax ate int totalsaleaTax gettotalsalesPerMonth (totalsalesTax) 39 int Sales: cout > Sales: 43 return sale8: 45 how reauice modules calculaces the scace and county tax based on the sales cax 47 void showResults (int totalSalesPerMonth) Defining variables int countysalesTax: int stateSalesTax int totalsalesTax; 53 56 calculat the amount of county, 1e5 tax 58 59 count ySaleaTax- totalSalesPerHonth * countyTax 61 Logs& others Acode:aodes x-4search results xlAcccc x Buld log | Build messages xlA Cocc X Build log X Line Hessage -Basid file: "no targ:" in "no Project. (compiler: unknown)-- C:UsersJanar..4Sxpected unqunlifsed-id before' token 1 19WeekProjectProject3-10.cpp Windows (CR+LF) WINDOWS-1252 Line 18, Col 11, Pos 450 Read/Write default Type here to search E, d. dS 12:55 PM 2/11/21>19 p.oject3.. O cpp-Code::Eccks 17.12 File Edit View Search Project Build Debug Fortren wxSmith Tools Tools+Plugins DoxyBilocks Setings Help Start here Project3. 10.cppX Projects Symbos Fies Workspace int countysalesTax: int stateSalesTax int tozalsalesTax 53 56 calculat the amount of county, 1e5 t2LX 58 59 61 64 5 Dsaplay the anount of county sales tax cout 19
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started