title: How can I combine an extra variable to an array/method?
body: <p>I have created a simple program which outputs student details. Ideally I would like to give the user an option to add both courses.  Will this require a lot of messing about changing code? If not can someone help?</p>
  
  <pre><code>class Student
  {
      public static void main(String[]args)//The main method; starting point of the program.
      {
          Scanner input = new Scanner(System.in);
  
          String surName, foreName, courseName;
          int age,telephone;
  
          System.out.println("\t\t\t***********************************************");    
          System.out.println("\t\t\tWelcome to the Mobile College's Student Records");
          System.out.println("\t\t\t***********************************************");
          System.out.println("\nHow many students would you like to add?");
          int noStudents = input.nextInt();
  
          Stu [] TheStu = new Stu [noStudents];
  
          for (int x = 0; x &lt; noStudents; x++)
          {
              System.out.println("Please enter Surname: ");
              surName = input.next();
              System.out.println("Please enter Forename: ");
              foreName = input.next();
              System.out.println("Please enter Age: ");
              age = input.nextInt();
              System.out.println("Please enter Telephone No. ");
              telephone = input.nextInt();
              System.out.println("Which course do you want to add the student to? .......Literacy or Numeracy  ");
              courseName = input.next();
  
              TheStu [x] = new Stu (surName, foreName, age, telephone, courseName);
          }
  
          for (int y = 0; y &lt; noStudents; y++)
          {
              System.out.println("\t\t\t***********************************************");
              System.out.println ("\t\t\tName: " + TheStu[y].getfName() + " " + TheStu[y].getsName());
              System.out.println ("\t\t\tAge: " + TheStu[y].getstuAge());
              System.out.println ("\t\t\tTelephone No. 0" + TheStu[y].getphone());
              System.out.println ("\t\t\tEnrolled on the " + TheStu[y].getcourseType() + " Course.");
              System.out.println("\t\t\t***********************************************");
          }
  
      }// end of class
  }
  
  class Stu
  {
      private String sName;
      private String fName;
      private int stuAge;
      private int phone;
      private String courseType;
  
      Stu (String s, String f, int a, int p, String c)
      {
          sName = s;
          fName = f;
          stuAge = a;
          phone = p;
          courseType = c;
      }
  
      String getsName()
      {
          return sName;
      }   
  
      String getfName()
      {
          return fName;
      }   
  
      int getstuAge()
      {
          return stuAge; 
      }
  
      int getphone()
      {
          return phone; 
      }
  
      String getcourseType()
      {
          return courseType;
      }
  }
  </code></pre>