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
This is the design of the application.
This image shows the applications form when it starts running and processes the data in the file:
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 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started