Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Identify the three functional components of the marketing process.

Answered: 1 week ago

Question

manageremployee relationship deteriorating over time;

Answered: 1 week ago