title: Removing a specific element from array through user input
body: <p>I am a bit new to arrays and I'm wondering how I can ask a user to input which movie they want to remove from the list of available movies and then how to return a new list that bumps each other movie up one spot. I've watched a bunch of videos but I can't figure it out.. :( It will ask me to enter my username, then show me the menu options. But once I press 3, it does not ask me which movie I would like to delete and it does not remove a movie from the array</p>
  <pre><code> package practice;
  
   import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.List;
   import java.util.Scanner;
  
   public class Practice {
       public static void main(String[] args) {
           Scanner input = new Scanner(System.in);
           Scanner sc = new Scanner(System.in);
      
           List&lt;String&gt; allowedUsernames = Arrays.asList(&quot;John&quot;, &quot;Sam&quot;, &quot;Lucy&quot;, &quot;Arthur&quot;, &quot;Trisha&quot;);
           System.out.println(&quot;Welcome to the Java movie rental store! To start, please enter your username!&quot;);
  
           String name = &quot;&quot;;
          
           do {
               if (!name.equals(&quot;&quot;)) {
                   System.out.println(&quot;Please enter a valid username.&quot;);
               }
  
               name = input.nextLine();
           } while (!allowedUsernames.contains(name));
                  
           System.out.println(&quot;Hello &quot; +name+ &quot;! Please select from the following menu options!&quot;);
          
           getchoices();
       }
      
       public static void getchoices() {  
           Scanner scan = new Scanner(System.in);
          
           String[] optionslist = {
               &quot;1) See full list of movies&quot;,
               &quot;2) Add a movie&quot;,
               &quot;3) Delete a movie&quot;,
               &quot;4) Modify a movie&quot;,
               &quot;5) Exit&quot;
           };
          
           for (int i = 0; i &lt; optionslist.length; i++) {
               System.out.println(optionslist[i]);
           }
          
           int number = scan.nextInt();
           System.out.println(&quot;You selected: &quot; + optionslist[number-1].substring(3, optionslist[number - 1].length()));
           movieList();
       }
       
       public static void printNewMovielist() {
           // TODO Auto-generated method stub
           String[] newList = {
               &quot;Shrek&quot;,
               &quot;Beauty and the Beast&quot;,
               &quot;Wall-E&quot;,
               &quot;Cinderella&quot;,
               &quot;Alice in Wonderland&quot;
           };
      
           System.out.println(&quot;Movies Available: &quot;);
           newMovieList(newList);
      
           newList = deleteMovies(newList); 
           System.out.println(&quot;The updates list of movies available at the rental store: &quot;);
           newMovieList(newList); 
           deleteMovies(newList); 
       }
  
       public static void movieList() {   
           ArrayList&lt;String&gt; Movies = new ArrayList&lt;String&gt;();
          
           System.out.println(&quot;Movies Available:&quot;);
          
           Movies.add(&quot;Shrek&quot;);
           Movies.add(&quot;Beauty and the Beast&quot;);
           Movies.add(&quot;Wall-E&quot;);
           Movies.add(&quot;Cinderella&quot;);
           Movies.add(&quot;Alice in Wonderland&quot;);
          
           for (int i = 0; i &lt;Movies.size(); i++) {
               System.out.println(Movies.get(i));
           }
       }
  
       public static String[] deleteMovies (String [] newList) { 
           String[] deleteMovie = new String [newList.length - 1]; 
      
           for (int i = 0; i &lt; newList.length; i++) { 
               deleteMovie[i] = newList[i]; 
           }
      
           Scanner sc = new Scanner (System.in); 
           System.out.println(&quot;Which movie would you like to delete?&quot;); 
      
           return deleteMovie; 
       }
  
       public static void newMovieList(String [] newList) { 
           for (int i = 0; i &lt; newList.length; i++) { 
               System.out.println((i - 1) + &quot; )&quot; + newList[i]);   
       }
   }  
  </code></pre>