Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ please in a simply form is possible. s. The file black friday but contains sales data for Black Friday 2020 and 2021 for
in c++ please in a simply form is possible.
s. The file black friday but contains sales data for Black Friday 2020 and 2021 for different retailers. Your program will read from a data file and determine which year had higher sales. It will count how manystores had higher sales for 2021. It will also compute total sales of 2021 Each line of the file blackFriday.txt contains the store namo, sales for 2020 and sales for 2021. A fewines in the file are shown: Walmart 7.42 7.96 Target 6.32 6.46 The first line means that Walmart had 7.42 billion dollars in sales on Black Friday of 2020, and 7.96 biliondollars in sales on Black Friday of 2021 Since we don't know how many stores are in the file we do not know how many lines there are inthe file. Write a C++ program (put your code on the next page) that will do the following: a Open the file and read in the data. b. Calla value returning function that returns an integer indicating which year had higher sales c Compute the total sales from 2021. d. Compute how many stores had higher sipas in 2021. e Print the output so that it is organized as below. (Of course, there will be more lines, because thisis shown only for the lines above). Note the dollar amounts are printed to two decimal places. All printing is done in the main function. Better Year 2021 2020 Store 2020 Sales 2821 Sales Walmart 7.42 7.96 Target 6.32 6.24 Total sales in 2821 is: 14.20 Total number of stores that improved in 2021: 1 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