I am working on a program with the following requirements:

Write a program to calculate the average of all scores entered between 0 and 100. Use a sentinel-controlled loop variable to terminate the loop. After values are entered and the average 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-100; B—80-89; C—70-79; D—60-69; F < 60

Here is what I have so far:

``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PRG205_FinalAssessment_Doyle
{
class Program
{
static void Main(string[] args)
{
int[] marks;
int minput = 1, counter = 0, total = 0;
float aveg = 0.0f;
marks = new int;
while (minput > 0)
{
if (minput >= 0)
{
marks[counter++] = minput;
total += minput;

Console.WriteLine("Enter student grade or any negative value to calculate average");
``````

Don't forget closing braces. Read your assignment very good, you don't use a sentinel value.
Here is what I quickly made of it so far.

``````int[] marks;
int minput = 1, counter = 0, total = 0;
float average = 0.0f; //try to alway use meaningful names so, no 'aveg' 'a' etc;

int sentinel = 999;
marks = new int;
Console.WriteLine("Type 999 to end.");
//Collect marks and total