Instruction
Program Main Menu
The program should start with the page displaying a message that prompt()s the user to enter either 1, 2, 3, or “Exit”.
The following steps dictate what will happen when the user enters a number in the prompt() described above
Program 1 – (User enters 1 in the Main Menu to get here)
The program should prompt() the user to enter a String.
If the user doesn’t enter anything, the program should write “You need to enter something” into the console window and should prompt() them again to enter a String.
If the user enters a String, the program should return to “Program – Main Menu”.
Program 2 – (User enters 2 in the Main Menu to get here)
If the user has already entered a String in step “Program 1”, the program should convert the String into “ROBOT Language”, write “String converted” to the console window, and return to “Program – Main Menu”.
If the user hasn’t already entered a String in step “Program 1”, the program should write “You need to first enter a String” to the console window and return to “Program – Main Menu”.
Program 3 – (User enters 3 in the Main Menu to get here)
If a String has already been converted in step “Program 2”, the “ROBOT Language” version of the String should be written to the console window and the program should clear all Strings and return to “Program – Main Menu”.
If a String hasn’t already been converted in step “Program 2”, the program should write “You need to first convert your String” to the console window and return to “Program – Main Menu”.
Program Exit – (User enters “Exit” in the Main Menu to get here)
If the user enters “Exit” in the Main Menu, the program should write, “Thanks for using the ROBOT Language Converter!” to the console window and stop executing.
ROBOT Language Spec
ROBOT Language is a pattern-based language as follows:
If a word is five or more letters long, add “-bork” to the end of the word
If a word is less than five letters long, add “-boink” to the end of the word
For example: “The quick brown fox” becomes “The-boink quick-bork brown-bork fox-boink"