Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ please s. The file black friday but contains sales data for Black Friday 2020 and 2021 for different retailers. Your program will read

In c++ please
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago