Answered step by step
Verified Expert Solution
Link Copied!

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.
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_2

Step: 3

blur-text-image_3

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

Evaluate each of the following: (a) 33i=1 i (b) 33i=1 i2.

Answered: 1 week ago

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago