title: So I want the program to compute the grades inputted by the user when the user types in "N"
body: <p>I created an array named grades that prompts the user to input a grade then it will ask the user if he/she wants to input more grades. The user will just need to press Y to input a grade once more, then N, if the user wants to stop inputting grades and the program, should start computing the grades. But I'm stuck here.</p>
  <p>This is my code:</p>
  <pre><code>Sub Main()
      Dim inputhere, a, b As Integer
      Dim prompt As String
      a = 0
      Dim grades(a) As Integer
  
      Console.Write(&quot;Enter Grade: &quot;)
      inputhere = Console.ReadLine()
      grades(0) = inputhere
  
  
      While True
          Console.Write(&quot;Enter Again [Y/N]: &quot;)
          prompt = Console.ReadLine()
          If prompt = &quot;Y&quot; Then
              b = a + 1
              Console.Write(&quot;Enter Grade: &quot;)
              inputhere = Console.ReadLine()
              grades(a) = inputhere
          ElseIf prompt = &quot;N&quot; Then
              grades(a) += inputhere / b
              Console.Write(&quot;Average: &quot;)
          End If
      End While
      Console.ReadKey()
  End Sub
  </code></pre>
  <p><a href="https://i.stack.imgur.com/It8vr.jpg" rel="nofollow noreferrer">this is the output</a></p>
  <p>So what happens is that it doesn't compute the grade but continues to loop.</p>