Question: We want to create a short program that performs the following task. A user is asked if they would like to play a game.
We want to create a short program that performs the following task. A user is asked if they would like to play a game. If they answer y, yes, Yes or any other variation of the word (starting with a Y) - we will print to the screen "Hooray! So glad to be playing a game with you!". If they answer n, no, No or any other variation of the word No (starting with an N), then we will display to the screen "Sorry that you don't want to play with me :( ". If they enter any other value, we display "Sorry - didn't get that - please enter your choice again" and they will be prompted to run the program once more. Your code must include the following: to LowerCase function, a loop and the substr function
Step by Step Solution
3.46 Rating (146 Votes )
There are 3 Steps involved in it
Here is a Java program that performs the task as specified This program uses the toLowerCase functio... View full answer
Get step-by-step solutions from verified subject matter experts
