Create a program that will read 10 names and scores from the input.txt file which I have supplied. Make sure to use exception handling when opening this text file. Calculate the average, highest score, and lowest score Create your own Exception for two test: Test if average is less 60. If so, display a message from the c

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Make C#(sharp) code with visual studio:

Create a program that will read 10 names and scores from the input.txt file which I have supplied. Make sure to use exception handling when opening this text file.

Calculate the average, highest score, and lowest score

Create your own Exception for two test:

  1. Test if average is less 60. If so, display a message from the custom exception that says "Average not up to NC State standards. Class is eliminated."
  2. Test to see if there are any negative scores in the text file. If so, display a message from the custom exception that says "Invalid data. Please check file." Hint: to test this, edit the text file and put a negative score in. 

If average is 60 or greater with no negative scores, write the average, highest score and name, lowest score with name to an output.txt file (with exception handling when file is created).

Hint: Probably want to use StreamReader and StreamWriter to read the text file and write the output file..

Input.txt file data below:

Mary

90

Tony

20

Roy

60

Debbie

10

Sarah

80

Doug

30

Willy

10

Pete

30

Theresa

94

Zeus

36

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY