C# homework help, so close, yet so far
<p>1 question on each of my two homework assignments hoping to get some help for, please and thankyou.</p>

<p>buddy helped me on this, but had to leave, dont quite understand where/why the user must input a negative value to end the loop. how can i fix this?</p>

<p>assignment:
heres my homework assignment: Write a program to calculate the average of all the scores entered between 0 and 100. use a sentinel controlled loop variable to termintate 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. This is the scoring rubric. A-90-100; B-80-89; C-70-79; D-60-69; F &lt; 60. </p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace chap6que3
{
class Program
{

    static void Main(string[] args)
    {
        int[] marks;
        int minput = 1, counter = 0, total = 0;
        float aveg = 0.0f;
        String Gradeletter = "C";
        marks = new int[100];
        Console.WriteLine("Enter Student Grade");
        while (minput &gt; 0)
        {
            minput = Convert.ToInt32(Console.ReadLine());
            if (minput &gt;= 0)
            {
                marks[counter++] = minput;
                total += minput;

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



        }
        aveg = (float)total / (float)counter;
        Console.WriteLine("Average Grade %:  " + aveg.ToString());

        if (aveg &lt; 60)
        {
            Gradeletter = "F";

        }
        else if (aveg &gt;= 60 &amp;&amp; aveg &lt; 70)
        {
            Gradeletter = "D";

        }
        else if (aveg &gt;= 70 &amp;&amp; aveg &lt; 80)
        {
            Gradeletter = "C";

        }
        else if (aveg &gt;= 80 &amp;&amp; aveg &lt; 90)
        {
            Gradeletter = "B";

        }
        else if (aveg &gt;= 90)
        {
            Gradeletter = "A";

        }
        Console.WriteLine("Letter grade average is: " + Gradeletter);
        Console.ReadKey();
    }
}
</code></pre>

<p>2nd assignment help
simply write a loop program that if the user inputs a number between 10 and 50 and it passes. otherwise it fails.</p>

<p>right now if its under 10, it will say it fails, anything 10 or up passes though. i feel im close, yet so far. help please!</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace chap6que8
{
class Validator
{
    public static void Main(string[] args)
    {
        //initialize variables
        String userInput = "";
        int userInfo = 0, intValue;

        //provide instructions to the user
        Console.WriteLine("Please enter a value between 10 and 50:");

        //start the read process
        userInput = Console.ReadLine();

        //parse the user input
        int numValue;
        bool parsed = Int32.TryParse(userInput, out numValue);

        //while loop parameters
        while ((numValue &gt;= 10) &amp;&amp; (numValue &lt;= 50))
        {
            intValue = Convert.ToInt32(userInfo);
            userInfo += intValue;
            Console.WriteLine("Your Number is within the parameters, enter another number.");
            userInput = Console.ReadLine();
        }

        //end of program lines printed once number is outside the range
        Console.WriteLine("The Number you have entered is outside the parameters");
        Console.Read();
    }
}
</code></pre>
