Question: Write a SIMPLE program to demonstrate File I/O, output to the console screen, output to a file, arithmetic calculations, output formatting and proper declaration of
Write a SIMPLE program to demonstrate File I/O, output to the console screen, output to a file, arithmetic calculations, output formatting and proper declaration of variables.
Write a program to calculate total ticket sales after a football game. Output a report detailing the number of tickets sold and the total sale amount.
The program will read an input file TicketSalesData.txt containing a ticket price and number of tickets sold at that price. For example, the first row of TicketSalesData.txt contains:
250 5750 100 28000 50 35750 25 18750
Which consists of ticket price of $250; number sold 5750.
Program Name: Name of your choice
Program Specifications:
Include proper header files/libraries to perform file input, console output, and output formatting.
Your program should properly declare variables to store ticket price, number of tickets sold, total tickets sold, total sales and file streams.
Prompt the user for the input file name (TicketSalesData.txt).
Prompt the user for the output file name, name of your choice.
Open both the input and output files.
Read each row and store the data in the appropriate variables using C++ processes (not C input/output).
All data must be read from the file and not hard-coded as literal values. Calculations must be performed using the data read from the file and not hard-coded.
For each row of data, calculate the total of ticket sales for that row (see below for output)
Calculate the grand total of tickets sold (this will be a running total).
Calculate the grand total of sales (this will be a running total).
Output the following data in the following form to the console and to an output file, name of your choice:
(output the following information for each row of input)
Number of tickets sold at: $xxxx xxxxx for a total of $xxxxx
(output the following as a summary of ticket sales)
Report for game played
----------------------------------------
Number of tickets sold: xxxxx
Sale amount: $xxxxxx.xx
All currency must have a dollar sign and formatted for two decimal points, i.e., $222.00.
Note: xs are simply to demonstrate format. Manually spot-check calculations for accuracy.
should be the current date and should be in the form MM/DD/YYYY. The user may be requested to enter the date that will be displayed. I will award 2 (two) points extra credit if C++ code is used to retrieve the current date for display. This may require research on your part.
Close both the input and output files prior to program end.
Format your program properly for readability.
Submit your source file (*.cpp) and README file. You do not need to submit the executable file (*.exe) or the input file since it was provided.
Be sure to comment your code as outlined in the syllabus and provided example (Documentation.cpp). DO NOT FORGET TO INCLUDE YOUR NAME IN YOUR DOCUMENTATION, i.e.:
Program Name: (name of program file)
Author: (your name)
Brief explanation of program purpose
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
