title: Ending a program with ctrl+Z
body: <pre><code>    import java.util.Scanner;
  
  public class ClassAverage
  {
      public static void main(String args[])
      {
          String names[] = new String[50];
          int scores[] = new int[50];
          int entries = 0;
  
          Scanner in = new Scanner(System.in);
          //System.out.println("Enter number of entries");
          //int entry = in.nextInt();
  
          System.out.println("Enter the names followed by scores of students: ");
  
          for(int i = 0; i &lt; 50; i++)
          {
              names[i] = in.next();
              scores[i] = in.nextInt();
              entries++;
          }
          Average avg = new Average();
          double average = avg.CalcAvg(scores,entries);
  
          System.out.println("The class average is: " + average);
          avg.belowAvg(scores,average,names,entries);
          avg.highestScore(scores,names, entries);
      }
  }
  class Average
  {
      Average()
      {
          System.out.println("The averages: ");
      }
      double CalcAvg(int scores[], int entries)
      {
          double avg;
          int total = 0;
  
          for(int i = 0; i &lt; entries; i++)
          {
             total += scores[i];
          }
             avg = total/entries;
          return avg;
      }
  
      void belowAvg(int scores[],double average,String names[], int entries)
      {
          for(int i = 0; i &lt; entries; i++)
          {
              if(scores[i] &lt; average)
  
                  System.out.println(names[i] + "You're below class average");
  
          }
      }
  
      void highestScore(int scores[],String names[], int entries)
      {
          int max = scores[1];
  
          for(int i = 0; i &lt; entries; i++)
          {
              if(scores[i]&gt;=max)
                  max=scores[i];
          }
          System.out.println("The maximum score is: " + max);
          System.out.println("The highest score acheivers list: ");
  
          for(int i = 0; i &lt; entries; i++)
          {
              if(scores[i] == max)
                  System.out.println(names[i]);
          }
      }
  }
  </code></pre>
  
  <p>im suppose to hold the ctrlkey press z and then press the enter key to end the program but how do i do that? </p>
  
  <p>if you are wondering the program is to write a program that lets the user input student names followed by their test scores and outputs the class average, names of students below the average, and the highest test score with the name of student</p>