HOW to go about this program
Program specification:
Write a Java program that contains a main() method with code that does the following:
Has final data storage for a character with the value 'r'. (This is the "secret" letter.)
Allows the the user to enter a word (their guess), and accepts the user's entry; when the user enters "stop" the program ends.
When a word other than "stop" is entered, the user sees a message telling them whether or not their guess contained the secret letter and is asked for their next guess.
Sample output: (user's entry in bold)
enter your word, stop to end.
hello
Your guess does not contain the secret letter
enter next word, stop to end.
frog
Your guess contains the secret letter
enter next word, stop to end.
stop
I'm not sure how to go about making R the secret letter, any help would be greatly appreciated.
Thanks
Creeeds
Re: HOW to go about this program
"final data storage for a character with the value 'r'. "
Your instructions basically tell you. Do you know how to declare a variable? Do you know how to make the type of the variable be a character? Do you know how to make that variable final(constant)? Do you know how to assign a value to that variable? I am fairly sure the answer to all those questions is yes. Therefore you know how to do this.