title: Assigning user input (string) to an integer in Java
body: <p>If a user enters string, for example, "Sunday", how do I assign "Sunday" to an int value (such as zero)? </p>
  
  <p>EDIT:
  Here is the final code for calculating the day of the week after x number of days have elapsed. Not sure if this is the most efficient way.</p>
  
  <p>Thank you for everyone's expertise!</p>
  
  <pre><code>public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      System.out.print("Enter today's day: ");
      String day = input.next();
      int todayDay = changeToString(day);
      System.out.println(todayDay);
  }
  
  public static int changeToString(String day) {
      int dayName = 0;
  
      switch (day) {
  
          case "Monday":
              dayName = 1;
              break;
          case "Tuesday":
              dayName = 2;
              break;
          case "Wednesday":
              dayName = 3;
          case "Thursday":
              dayName = 4;
          case "Friday":
              dayName = 5;
          case "Saturday":
              dayName = 6;
  
      }
  
      int dayselapsed = input.nextInt();
      int futureday = (dayName + dayselapsed) % 7; 
  
      switch (futureday) {
  
          case 0: System.out.println("In " + dayselapsed + " days, it will be Sunday");
              break;
          case 1: System.out.println("In " + dayselapsed + " days, it will be Monday"); 
              break;
          case 2: System.out.println("In " + dayselapsed + " days, it will be Tuesday"); 
              break;
          case 3: System.out.println("In " + dayselapsed + " days, it will be Wednesday"); 
              break;
          case 4: System.out.println("In " + dayselapsed + " days, it will be Thursday"); 
              break;
          case 5: System.out.println("In " + dayselapsed + " days, it will be Friday"); 
              break;
          case 6: System.out.println("In " + dayselapsed + " days, it will be Saturday"); 
              break;
  }
      return 0;
  
      }
  
  }
  </code></pre>