Question: I need help writing this program out. thank you and I left the imput values for the program below. The input values for program #3
I need help writing this program out. thank you and I left the imput values for the program below.
The input values for program #3 are:
March 2021 53924.62
Use a text editor to create an input file named prog3_252inp.txt . Enter the values as shown above on one line (record).
/* File: prog3_bb0000.cpp // Remove this inline comment after replacing 'bb0000' with your account number. Author: Betty Boop // Remove this inline comment after replacing Betty Boop with your first & last names. C.S.1428.? // Remove this inline comment after replacing the '?' with your three-digit lecture section number. Lab Section: L? // Remove this inline comment after replacing the '?' with your two-digit lab section number. Program: #3 Due Date: --/--/-- // Remove this inline comment after replacing the dashes with the due date, in this format - month, day, year. A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected. This program reads the month (string), the year (integer), and the total amount (real) collected at the cash register (product sales + sales tax) from an input file. Sales tax consists of both a state sales tax and a city sales tax. For example, if the state sales tax is 4% and the city sales tax is 2%, the total sales tax would be 6%. Processing: If the total amount collected is known (and it is - it was read from the input file) and the total sales tax is 6% (city & state), the amount of the product sales is calculated as: S = T / 1.06 where S is the product sales and T is the total income (product sales plus sales tax). To encourage growth of small businesses, a small business owner receives a tax break on state taxes. If product sales for the month are less than $100,000, the business is only responsible for 90% of the taxes it would pay if product sales had met or exceeded $100,000. (Named constants are used for all literals.) Shown below is a sample layout for file output. Two blank lines are left after the author's identifying information before a sales tax report is printed. The output is displayed in tabular form with a 'title' and 'column headers'. After the sales tax report is generated, the author's identifying information is printed to the console. Two blank lines are left before a message is printed to the console letting the user know the name of the output file to which the sales report was written. Note the sample console layout below. Arrays are not used in generating the sales report. The string library is included since the month is read in as a string. Input(file - prog3_?inp.txt): month(string) year(int) total_collected(double) Constants: CITY_TAX_RATE (double) STATE_TAX_RATE (double) SALES_CUTOFF (double) TAX_BREAK (double) Output(console): (Sample Console Output) Author's Name C.S.1428.? // '?' represents a three-digit lecture section number Lab Section: L? // '?' represents a two-digit lab section number --/--/-- // dashes represent due date, month/day/yearThe << month >> tax report has been saved to prog3_?out.txt. Output(file - prog3_?out.txt): (Sample File Output) Author's Name C.S.1428.? // '?' represents a three-digit lecture section number Lab Section: L? // '?' represents a two-digit lab section number --/--/-- // dashes represent due date, month/day/year Month: << month >> , << year >> ---------------------------------------- Total Collected: $ total_collected Sales: sales City Sales Tax: city_tax State Sales Tax: state_tax Total Sales Tax: total_tax ---------------------------------------- =======================================================================
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
