Question: Sales Data Analysis You are tasked with creating an application that reads a files contents (File: SalesData) into an array, displays the arrays contents in

Sales Data Analysis

You are tasked with creating an application that reads a files contents (File: SalesData) into an array, displays the arrays contents in a ListBox control (Chapter 4), and calculates and displays the total, average, max, and min of the arrays values into a file called "SalesResults.txt". You will use a loop (Chapter 5) to read in the data from the file (Chapter 5), store the data into an array (Chapter 7), and save calculated results into a file (Chapter 5). Place the code in the Load event (Chapter 5) so that it will process all of the steps once the application starts.

Data in SalesData.txt File

Sales Data Analysis You are tasked with creating an application that reads

This is the design of the application.

a files contents (File: SalesData) into an array, displays the arrays contents

A message confirms that the data has been processed:

in a ListBox control (Chapter 4), and calculates and displays the total,

This image shows the applications form after the data has been processed:

average, max, and min of the arrays values into a file called

This image is the SalesResults.txt file after the data has been processed:

"SalesResults.txt". You will use a loop (Chapter 5) to read in the

NOTE:

Save the SalesData.txt file in the /bin/Debug folder so that you can simply write "SalesData.txt" for the file name when reading in the file. Once the file is stored in this folder, you won't have to include the file path for the application to find the file.

The output file should be named "SalesResults.txt" and will get stored in the /bin/Debug folder.

Point Breakdown:

Points Task
5 An array is created using a constant to store the size of the array.
10 The data file is opened and closed properly using StreamReader.
10 The data is read into the application from the file and stored into an array using a while loop.
15

The data in the array is totaled using a foreach loop.

The average, the maximum, and minimum value in the array is calculated using a for loop.

7 The data file is opened and closed properly using StreamWriter.
3

All controls have meaningful names.

50 TOTAL

SalesData No...- File Edit Format View Help 1425.73 1997.25 1033.52 3789.82 2109.27 1287.66 1972.39

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!