107 325
Assignments Done
98.9%
Successfully Done
In March 2023

# Answer to Question #253802 in C# for Kayla

Question #253802
Write a program to allow multiple sets of scores to be averaged. Valid entries must be numeric and in the range of 0 to 100. Calculate the average of the scores entered. Allow any number of scores to be entered per data set but assume that there will be at least one score entered. Use a sentinel-controlled loop variable to terminate the loop. After values are entered and average is calculated, test the average to determine whether an A, B, C, D or F should be recorded. The scoring rubric is as follows: A: 90 to 100; B80 to 89; C 70 to 79; D 60 to 69 and F <60.
1
2021-10-20T00:54:47-0400
using System;
using System.Collections.Generic;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double average;
double sum = 0;
double score = 1;
double totalScores = 0;

while (true)
{
Console.Write("Enter score in the range of 0 to 100 (-1 to exit): ");
if (!(score >= 0) || !(score <= 100))
{
Console.WriteLine("Going out");
break;
}
sum += score;
totalScores++;
}

average = sum / totalScores;
Console.WriteLine("Average: {0}", average);
if (average >= 90 && average <= 100)
{
}
else if (average >= 80 && average <= 89)
{
}
else if (average >= 70 && average <= 79)
{
}
else if (average >= 60 && average <= 69)
{
}
else
{
}

}

}
}

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!