Question: You will write a C# program to calculate player statistics in 3 sports: Soccer, Basketball, and Volleyball. Your program will input two pieces of information

You will write a C# program to calculate player statistics in 3 sports: Soccer, Basketball, and
Volleyball. Your program will input two pieces of information in sequence: the sport type
(Soccer,Basketball, or Volleyball) as a string, and the score as an integer made by a player
in a game. The program will continue to accept inputs until "Quit" is input as the sport type, which
will indicate that all the statistics have been entered. The program should accept sport-type inputs
in a case-insensitive manner. To proceed with data entry, the user must input one of the four valid
options: Soccer,Basketball,Volleyball, or Quit. Any input outside these options should
prompt the user to enter a correct sport type, ensuring that the program does not advance or end
prematurely until a valid input is received. Obviously, you need to use a loop to achieve this. After
receiving a valid sport type, the program will request the score achieved by a player in that sport.
The program must include a check to ensure the score is a non-negative integer. Any input of a
negative integer should prompt the user to re-enter a valid score. After Quit is entered as the
sport type, the program should stop collecting further input, and should calculate and display the
total number of scores recorded, the average score, and the highest score for each sport. The
program must include a mechanism to avoid division-by-zero errors when calculating averages,
particularly in cases where no scores were entered for a sport. Proper input prompts and output
message need to be written on the console. Include enough comments in the program to explain
your code.
Important: You are NOT allowed to use arrays or methods for this program. You can use any
type of loops or conditional statements (if-else or switch) in your program that has been taught
in the class. Do NOT use any C# language-features that has not been taught in the class. Check
the lecture slides to verify this. Some concepts may exist in the textbook, but we did not learn
those in the class. You are NOT allowed to use those. Submissions that utilize any C# languagefeatures beyond the lecture slides will automatically receive 0 in the assignment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!