Please download the files here:
Within this zip file, you will find three folders.
folder contains the data files for the projects. You want to place that on your hard drive at C:
You will notice in the two classes (SalesRecord.cs, Index.cs) the locaiton is specified as C:/data/
To make that work, place the data folder at C:
If you would rather type the full path into the application (i.e., C:/data/shoe_11232.txt
), then set location to be equal to an empty string:String location = "";
folder contains the application as a console application and the QuickSearch
folder contains the application as a windowed application.
To run these in Visual Studio 2008, go into VS2008 C# XXXXX and choose to open project. You will navigate to the solution file (.sln
) and select it to open the project.
In the console application, you start by entering the file name. The file names are:shoe_11232.txt
Assuming that you did not change the location variable, you simply type in one of those file names. In the windowed applicaiton, you type it into the text field and press load.
All entries in the two applications have error handling. If it cannot find the file, it will let you know.
Once the files is loaded, you will have the option to search or insert. These are pretty self expanitory.
As the requirements state, each file is for a specific item. I have sent you two shoe items. Within the file is a value pair of city and sales.
When you load a file in either application, an index file is created. This file is read in whever the file is loaded.
When you preforma search, it uses the index, and displays the sales amount for the city you search for. If the city is not in the file, it lets you know that the city is not found.
When you insert a record, it updates the index file. If you attempt to insert a record for a city that already has a record, the applications will let you know that a record already exists.
I've tested both applications and added error handling throughout. One important part is that the application can find the text files. So either use the C:/data/ location and simply type in the file name, change the location variable to anything you want, or set the location variable to empty and type in the full file path. That is up to you.
If you choose to leave the application as is, with it pointing toward C:/data/, then you should mention that in your notes when you submit the applications to your course. Most courses require that you say something along with the submission about how the application works. You should mention that the data files are included and should be placed at C:/data/ (i.e., the data folder should be placed at C:)
Everything has been compelted and all of the requirements have been met. If you have any questions, please let me know. I'm here to help.
If you require assistance in the future, please feel free to request me direclty by starting your questions with **For TheDoctor**
Please remember to rate my answer. Thank you so much and have a wonderful day!