title: java array that accepts input of put name mark, quit and get name (not working)
body: <p>im trying to write a program that will accept input of "put name mark", "get name mark" and "quit"</p>
  
  <p>upon the user entering "put name mark" the program will prompt them to enter a student name and mark and then stores it at the next available array index. </p>
  
  <p>the "get name" command will accept a name input from the user and they iterate through the array and display any mark matching the name entered. </p>
  
  <p>the "quit" command will end the program and return the mean mark and the highest mark in the display. </p>
  
  <p>the problem im having is that it dosent seem to be entering the loop when i type the required words in. it just jumps to where it asks the question again and wont even accept input</p>
  
  <p>im still a beginner and ive been working on this program for 4 weeks so any help would be greatly appreciated. </p>
  
  <pre><code>package week14;
  
  import java.util.Scanner;
  public class week {
  
  
  public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      //sets number of string inputs
      {
      String[] names = new String[50];
      double[] scores = new double[50];
      // Enter student name and score
  
      System.out.print("please enter either: quit, put name mark, get name");
      input.next();
  
  
          if(input.next() == "put name mark" )
          {
          System.out.print("Enter Student Name");
          names[50] = input.next();
          System.out.print("Enter Score");
          scores[50] = input.nextInt();
          }
  
      System.out.println("please enter either: quit, quit, put name mark, get name");
      input.next();
  
          if(input.next() == "get name")
          {
          System.out.print("please enter the name you would like to display the score for");
  
          String get = input.next();
          }
  
      // Sort
      for (int i = 50 - 1; i &gt;= 1; i--) {
          // Find the maximum in the scores[0..i]
          double currentMax = scores[0];
          int currentMaxIndex = 0;
          for (int j = 1; j &lt;= i; j++) {
              if (currentMax &lt; scores[j]) {
                  currentMax = scores[j];
                  currentMaxIndex = j;
              }
          }
  
          // Swap scores[i] with scores[currentMaxIndex];
          // Swap names[i] with names[currentMaxIndex] ;
          if (currentMaxIndex != i) {
              scores[currentMaxIndex] = scores[i];
              scores[i] = currentMax;
             String temp = names[currentMaxIndex];
              names[currentMaxIndex] = names[i];
              names[i] = temp;
          }
  
          if (input.equals("quit")){
          System.out.print(names[i] + scores[i]);
          System.out.println();
          System.out.print(currentMax);
          break;
          }
              }
          }
      }
  }
  </code></pre>