Menu

[solved]-Write Program Asks User Many Problems Prompt Instruct Enter Number 3 99 Check Make Sure Co Q39063309

You will write a program that asks a user how many problems they have- In your prompt instruct them to enter a number between

You will write a program that asks a user how many problems they have- In your prompt instruct them to enter a number between 3 and 99. (Check to make sure they comply.) You will then print a line for each of their problems finishing off with a line saying they have no problems. You will then ask if they have any more problems to start the process again Finish your program with a pleasant output line to let the user know he/she is done. Hints: You need to account for the difference between 1 “problem” and 2 or more “problems”. Since you are using inputs of an integer and a string value you may consider either 2 scanner objects or you will have to parse the integer out of a string. If your outer loop repeats on an input of “yes” or “y” then make sure to use the scannerName.equals rather than the == syntax Example output: How many problems do you have? I’m sorry you need to enter a number between 3 and 99, please re-enter an integer in that range. (Enter a number 3-99) 2 How many problems do you have? (Enter a number 3-99) 4 You have 4 problems but Java ain’t one You have 3 problems but Java ain’t one You have 2 problems but Java ain’t one You have 1 problem but Java ain’t one You got no problems left. Do you want more problems: Yes or No? yes HOw many problems do you have? You have 3 problems but Java ain’t one You have 2 problems but Java ain’t one You have 1 problem but Java ain’t one (Enter a number 3-99) 3 You got no problems left. more problems: Yes or No? Do you want no I’m glad you are OK Show transcribed image text You will write a program that asks a user how many problems they have- In your prompt instruct them to enter a number between 3 and 99. (Check to make sure they comply.) You will then print a line for each of their problems finishing off with a line saying they have no problems. You will then ask if they have any more problems to start the process again Finish your program with a pleasant output line to let the user know he/she is done. Hints: You need to account for the difference between 1 “problem” and 2 or more “problems”. Since you are using inputs of an integer and a string value you may consider either 2 scanner objects or you will have to parse the integer out of a string. If your outer loop repeats on an input of “yes” or “y” then make sure to use the scannerName.equals rather than the == syntax Example output: How many problems do you have? I’m sorry you need to enter a number between 3 and 99, please re-enter an integer in that range. (Enter a number 3-99) 2 How many problems do you have? (Enter a number 3-99) 4 You have 4 problems but Java ain’t one You have 3 problems but Java ain’t one You have 2 problems but Java ain’t one You have 1 problem but Java ain’t one You got no problems left. Do you want more problems: Yes or No? yes HOw many problems do you have? You have 3 problems but Java ain’t one You have 2 problems but Java ain’t one You have 1 problem but Java ain’t one (Enter a number 3-99) 3 You got no problems left. more problems: Yes or No? Do you want no I’m glad you are OK

Expert Answer


Answer to You will write a program that asks a user how many problems they have- In your prompt instruct them to enter a number be… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *