code: public static String getInput(String prompt) {
          System.out.print(prompt);
  
          try {
              BufferedReader in =
                  new BufferedReader(new InputStreamReader(System.in));
              return in.readLine();
          } catch(IOException e) {
              return null;
          }
      }
docs: Displays a prompt and then reads in the input from System.in.
  
  @param prompt  the prompt to be displayed
  @return <code>String</code> the input read in (entered after the prompt)