Reading and Writing Data Files Assignment Overview In the previous assignment, you wrote a program using a Course class and hard-coded data to create a listing of available courses. This assignment...

1 answer below »

Reading and Writing Data Files


Assignment Overview


In the previous assignment, you wrote a program using a Course class and hard-coded data to create a listing of available courses. This assignment provides part of the code for a simple registration application, but instead of using hard-coded data, it will read the course information from a text file. The program will enforce some basic registration rules and write the user's selections to a file.


Assignment Instructions



  1. Download the file cf_u02a1_Registration_File.ZIPfrom the Resources.Unzip this file and open the solution it contains in Visual Studio. You may wish to delete or rename the original ZIP file to avoid confusion with the ZIP file holding your completed work.

  2. Study the code provided in the project to understand what it does and how it works. Pay particular attention to the comments in the source code. As you write code in the steps below, be sure to document it appropriately with comments.

  3. Complete the code for the readDataFromFile() method so that it reads the text data from the course.data.txt file provided in the solution and creates a List collection of courses available for registration. Be sure to include appropriate exception handling.

  4. Complete the code for the static ValidateRegistration() method in the RegistrationValidator class so that it enforces the following registration rules:

    • The user may only select from the list of courses.

    • The user may not register for the same course twice.

    • The user may not register for more than 9 credits.



  5. Complete the code for the writeRegistrationToFile() method so that course number, course title and credits for each valid registration are written (1 course per line) to a file called registered.courses.txt. You should include appropriate exception handling.

  6. Zip the modified Visual Studio solution and submit it as an attachment for this assignment.


Assignment Requirements


Be sure that your program:



  • Is a syntactically correct, well documented C# console application that compiles and runs without warnings or errors.

  • Reads course data from the course.data.txt file with appropriate exception handling.

  • Parses the data from the text file correctly.

  • Creates a List collection of available courses for display and selection.

  • Writes valid registrations to the registered.courses.txt file with appropriate exception handling.

Answered 1 days AfterApr 17, 2022

Answer To: Reading and Writing Data Files Assignment Overview In the previous assignment, you wrote a program...

Aditya answered on Apr 19 2022
92 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here