Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

This is the design of the application.

image text in transcribed

A message confirms that the data has been processed:

image text in transcribed

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

image text in transcribed

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

image text in transcribed

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

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions