Question
Problem 1: The RepeatMessage class Target: This Java program will repeatedly print a certain message until the user tells the program to stop. The message
Problem 1: The RepeatMessage class
Target:
This Java program will repeatedly print a certain message until the user tells the program to stop.
The message to be printed would look as follows:
Specifications:
You do not necessarily need another method in addition to the main method to finish this program.
main Method
a) The main method should first create a message as a string literal She sells seashells by the seashore.
b) The main method should also create a Scanner object to get the users input from the keyword.
c) The main method will first output the message once.
d) The main method will then ask the user whether wants to continue.
e) Based upon the users input to decide whether to continue printing the message again or stop.
A message will be printed once again if the user inputs either yes, YES, Yes, Y or y
The message will stop being printed out if the user inputs either NO, no, No, N or n.
Please use hasNext Methods for the Do you want to hear it again part
She sells seashells by the seashore. Do you want to hear it again? lves She sells seashells by the seashore Do you want to hear it again? She sells seashells by the seashore. Do you want to hear it again? YES She sells seashells by the seashore. Do you want to hear it again? NoStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started