Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# please complete the code as per the instructions below: 1. Add code to the GetItems method that creates a StreamReader object with a FileStream

C#

please complete the code as per the instructions below:

1. Add code to the GetItems method that creates a StreamReader object with a FileStream object for the InventoryItems.txt file thats included in the project. (The Path constant contains the path to this file.) The file should be opened if it exists or created if it doesnt exist, and it should be opened for reading only.

2. Add code that reads each record of the text file, stores the fields, which are separated by pipe characters, in an InvItem object, and adds the object to the List object. Then, close the StreamReader object.

3. Add code to the SaveItems method that creates a StreamWriter object with a FileStream object for the InventoryItems.txt file. The file should be created if it doesnt exist or overwritten if it does exist, and it should be opened for writing only.

4. Add code that writes each InvItem object in the List object to the text file, separating the fields with pipe characters. Then, close the StreamWriter object.

5. Test the application to be sure it works correctly.

The code is to be included in the attached project.

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago