Define the method called getStringInput( ) using the method header : Public static String getStringInput(String prompt)

Define the method called getStringInput( ) using the method header:

Public static String getStringInput(String prompt)

This method must do the following:

  • Use JOptionPane.showInputDialog( ) to display the prompt.
  • Check the value that is returned.
  • If the value is null, the program should terminate.
  • If the value is a nonempty string, that string should be returned as the value of the method.
  • Otherwise, this request sequence should be repeated up to 3 times.
  • If the customer has not entered a valid input by then, the program should make an appropriate comment and then terminate.