Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

For this lab create library of static input methods called SafeInput. The library will be in a file called SafeInput.java .

For this lab create library of static input methods called SafeInput. The library will be in a file called SafeInput.java.

Include a copy of the library in the netbeans project folder in the default package along with the other file(s) in the task. Use the name of the file as the prefix for calling the methods. So SafeInput.METHODNAME is how it should call the method from the file. Here is an example. If it wants to get the name of the user. It can only insure that it is not a blank String as far as validating it. I'd use my getNonZeroLenString(Scanner pipe, String prompt) method for this.

So, have a java main file called GetUserName. In that file created the Scanner and name variable. make sure there is a copy of SafeInput in the same folder.

Part A: getNonZeroLenString

public static String getNonZeroLenString(Scanner pipe, String prompt)

-      Pipe is a Scanner object that is created in main i.e. in, console

-      Prompt is the message to display as the prompt for the input

use this method when don't know what form the user's response will be, but know that it must not be blank. For instance, asking for the user's name. There is no reasonable way to verify a human name but do know that it should not be blank

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question