Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

This is the design of the application.

image text in transcribed

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

image text in transcribed

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

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago