Program Menu
Hi,
I am trying to work out how to do this: I really have no idea what to do, and any help would be gratefully appreciate.
Program Menu
The menu should function in the following manner:
a) It should present a list of available menu options to the user as follows:
A.Print a number pattern
B.Reverse a string
X.Exit the program
b) The menu should allow the user to select an option repeatedly until the exit ("X") option is selected.
c) The menu sould accept both the uppercase and lower case versions of a characters 'b' and 'B' as valid selections.
d) If the user enters an invalid selection then the program should display a suitable error message and continue onto displaying the menu options and prompting the user to enter their selection as per usual.
e) The program should only ever terminateif the user selects the exit option from the menu.
f) When the user selects a valid option other than the exit option the program should shift from "menu Mode" into processing for the selected option.
g) Once the processing for the option the user has selected has been completed the program should automtically return to the menu.
PRINT PATTERN FEATURE
The "print Pattern" feature should function as follows:
The user should be prompted to enter the following input values:
the number of rows in the pattern to be printed
and the actual charagter to be printed in the pattern
The feature should then proceed to print a triangular pattern of the specified character based on the number of rows specified by the user as follows:
number of rows:4
character to be printed:'X'
Output:
X
X X
X X X
X X X X
(Note that there is a space after each character that was printed)
The pattern should be printed using a nested loop which prints the characters in the pattern ONE AT A TIME (in the inner loop) - marks will be deducted from this section for hard-coding pattern output in any way.
REVERSE A STRING FEATURE
The "reverse a string" featur should function as follows:
the user should be prompted to enter the a string (line of text).
the feature should then proceed to construct another String objectwhich contains the characters from the string entered by the user in REVERSE ORDER.
this string should then be dispalyed to the monitor.
when constructing the string which contains the characters from the string entered by the user you may find it useful to use the concatenation operator ("+") and the charAt() method (from the String class)

