Answer to Question #314501 in C# for clio

Question #314501

Design and implement a program that computes final averages for a set of grades. The program reads the grades from a user. (10) The format of a grade line is: N grades1, grades2, …………., grades5 Where N is total number of students and grades is the ith score. All scores must be between 0 and 100. The program reads the grades from the user, calculate and display the average


The weighted average is computed as:

NB: Your program should validate its input. That is, it should make sure each score is between 0 and 100 and that each student has n scores/ grades. If a student’s grades are invalid, the program should display an error message. The program should contain modules / functions that handles validating the input


1
Expert's answer
2022-03-19T12:24:52-0400
  static void Main(string[] args)
		{ 
			int grade;
			string name;
			string[] arr = new string[10];
			for (int j = 0; j < 10; j++)
			{
				Console.WriteLine("Enter name student:");
				name = Console.ReadLine();
				for (int i = 0; i < arr.Length; i++)
				{
					grade = int.Parse(Console.ReadLine());
					if (grade >= 0 && grade < 101)
					{
						
					}
					else
					{
						Console.WriteLine("Error");
						break;
					}
				}
			}
		}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS