Question: Using c# in visual studio 17 Total Sales You are tasked with creating an application that reads a files contents (File: Sales) into an array,

Using c# in visual studio 17

Total Sales

You are tasked with creating an application that reads a files contents (File: Sales) into an array, displays the arrays contents in a ListBox control (Chapter 4), and calculates and displays the total of the arrays values. You will use a loop (Chapter 5) to read in the data from the file (Chapter 5) and store the data into an array (Chapter 7). Place the code in the Load event so that it will process the data and calculate sales once the application starts.

Data in Sales.txt File

 Using c# in visual studio 17 Total Sales You are tasked

This is the design of the application.

with creating an application that reads a files contents (File: Sales) into

This image shows the applications form when it starts running and processes the data in the file:

an array, displays the arrays contents in a ListBox control (Chapter 4),

NOTE:

Save the Sales.txt file in the /bin/Debug folder so that you can simply write "Sales.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.

By the due date listed in D2L, submit the following into D2L Lab Work 3:

Zipped files and folders for the application named: LabWork3_ROakley (replace the instructor's name with the student name)

Point Breakdown:

Points Task
10 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.
10 The data in the array is totaled using a foreach loop and displayed in an output label.
3 All controls have meaningful names.
2 Files and folders properly zipped and submitted in D2L folder.
50 TOTAL

Sales-Notepad- File Edit Format View Help 1245.67 1189.55 1098.72 1456.88 2109.34 1987.55 1872.36

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!