Write a program that has the following menu of options as listed below. When a user chooses a particular option, your program should prompt the user for the required information (in main) to complete the task, and then pass it to a method.
///////////////////MENU///////////////////////////////
//1. Let’s Draw Trees!
//2. Reverse words
//3. Print Vertical
//4. Add digits
//5. Furbish Translator
/////////////////////////////////////////////////////////
1. Tree drawing program - You will need to ask the user for the number of segments and the height of each segment.
2. Your reverse word method, should print a given word in reverse. For example, if the user enters “helloâ€, this method should print it back to the screen as “0llehâ€.
3. The Print Vertical Method - For example, if the user enters “HELLOâ€, this method should print it back to the screen as:
H
E
L
L
O
4. Write a method that computes the sum of the digits in an integer. For example SumDigits(234) would return and print the value for 2 + 3 + 4 = 9. You only need to print the sum, and not all of the original digits.
5. Using the Furbish online Dictionary, create a method that accepts a word in furbish and returns the English translation. (use a value returning method) The translation should be a returned value to main, which then prints it for the user, do not print the result from within the method. Use at least 10 words.
So for example if the user type in “A-loh†the program should print:
You entered A-loh which means Light in Furbish.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.
public static void main(String[] args) {
String [] furbish = {"Ay-ay","Ah-may","A-loh","Aloh / may-lah","A-tay","Boh-bay","Boo","Dah","Doo?","Doo-ay","Doo-moh","E-day","Kah","Kkoh-koh","Koo-dye","Kah/boo/koo-doh","Lee-koo","Loo-loo","May-may","May-lah","May-tah","Mee-mee","Nah-Bah","Nee-tye","Noh-lah","Noo-loo","O-kay","Toh-dye","Toh-loo","U-nye","U-tye","Wah!","Way-loh","Wee-tee"};
String [] english = {"Look/See","Pet","Light","Cloud","Hungrey/Eat","Worried","No","Big","What?","Fun","Please feed me","Good","Me","Again","Health","I'm not healthy","Sound","Joke","Love","Hug","Kiss","Very","Down","Tickle","Dance","Happy","OK","Done","Like","You","Up","Yipeee!!","Sleep","Sing"};
Scanner console = new Scanner(System.in);
int selection = 1;
while (selection != 6) {
selection = getSelection(console);
switch(selection){
case 1:
drawTree(console);
break;
case 2:
reverseWord(console);
break;
case 3:
verticalWord(console);
break;
case 4:
AddDigits(console);
break;
This is only a preview of the solution.
Please use the purchase button to see the entire solution.