Display the prompt followed by suitable explanatory text such as ‘(yes/no)’. Do not use nextBoolean(), since it only works with the inputs ‘true’ and ‘false’. Instead use the Scanner’s next() method to read in the next String the user enters. If the user enters “y”, “yes” or “true” (in any case) then the method should return true. If the user enters “n”, “no” or “false” (in any case) then the method should return false. If they enter any other value then display an error and prompt them again, as done in askForInt and askForDouble.

Order your Assignment today and save 15% with the discount code ESSAYHELP

X