Question
Create a new Console Application project called ImportExportApp (without quotes). In your Program.cs file, inside your ImportExportApp namespace and outside the Program class,
Create a new Console Application project called "ImportExportApp" (without quotes). In your Program.cs file, inside your ImportExportApp namespace and outside the Program class, create a new class called Student.
This class should have three public auto-implemented properties:
- [2] StudentID (string)
- [2] FullName (string)
- [2] Email (string)
[3] In the Student class, override the ToString() method in a way that meaningful information is displayed for Student objects.
In addition, the Student class must have two static methods:
[5] 1 - SaveToFile: Saves one or more Student objects to a specified text file (i.e. Students.txt). This method receives two parameters:
- The first is a list of Student objects to be saved (Hint: You must use lists, not arrays),
- The second is a string that represents the file name of the text file.
This method "returns" void, and writes each student object in an individual line in the text file. Each line contains the values of each property, in the following order: StudentID, FullName, Email. Each value should be separated by a comma "," character.
[5] 2 - LoadFromFile: Loads one or more Student objects from a specified text file (i.e. Students.txt), which comes in the same format as specified for method SaveToFile. This method receives one parameter: A string representing the file name of the text file to be loaded.
This method returns a list of Student objects loaded from the targeted file (Hint: You must use lists, not arrays).
Once you are done, go back to the Main method in your Program.cs file, and write the test harness that fully demonstrates that your code works as per requirements. In other words:
[2] - You must invoke the SaveToFile method to write a list of student objects to your hard disk.
[2] - Then invoke the LoadFromFile method to load the data from the file you have just created.
[2] At the end, make sure to include a loop that iterates over the list of Student objects you have just loaded from the file, and display their information in the Console.
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