Question
In your Program.cs file, inside your Question03 namespace and outside the Program class, create a new static class called NumberService. In this class, implement two
In your Program.cs file, inside your Question03 namespace and outside the Program class, create a new static class called NumberService. In this class, implement two static methods: SaveNumbers and LoadNumbers. The first method, SaveNumbers, is intended to write a specified list of integers to the hard drive as a text file (.txt), in a specified location. It takes two parameters: A list of integers containing the numbers to be saved, and a string that defines the full physical path of the file that will be created (i.e. C:\MyFolder\Example.txt). Each list element must be written in a new line. The second method, LoadNumbers, is intended to read and return a list of integers parsed from all numbers read from a specified text file. It should take only one parameter: A string containing the full physical path to the file that will be loaded (i.e. C:\MyFolder\Example.txt). Once you are done, write the test harness in the Main method of your Program class, ensuring both methods are fully demonstrated. In other words, call the first method to write a file to your hard drive, and afterwards, call the second method to read the very file you have just created (do include a Console.WriteLine or equivalent at the end to display the content you have just loaded). Your code must be tested with a list of integers which size is determined by the last digit of your student number multiplied by 5. For example, if the last digit of your student number is 1, your list should have size 5. If the last digit of your student number is 2, your list should have size 10. If the last digit of your student number is 0, your list should have size 100. The content of this list can be creatively defined by you. You can choose your lucky numbers freely.
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