Question: An instructor is teaching three courses: A, B & C. They want to calculate the average and maximum marks in these 3 courses. You will

An instructor is teaching three courses: A, B & C. They want to calculate the average and maximum marks in these 3 courses. You will write a C# program to help them. Your program will take two inputs at a time: the course id (A, B or C) and the mark of a student (an integer). The program will keep taking inputs from the instructor until they enter Q as the course id which indicates no more marks to enter. Both lowercase and uppercase inputs will be accepted for the course id. The instructor must enter one of the four options (A, B, C or Q) to proceed. Giving any other letter as input will prompt the instructor again to input a letter, i.e., the program execution will neither proceed nor stop until a valid input is given. Obviously, you need to use a loop achieve this. After a valid input of the course id, your program will prompt to enter the mark of a student. For the marks, your program will also conduct a validity check where the mark must be nonnegative. Any negative mark will prompt the instructor again to enter the mark. After the instructor gives Q as the course id, the program will not ask for any more marks, and print the number of students, the average, and the maximum for each of the three courses. Do not forget to check for division by zero before calculating average. Do not use keywords like stop

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!