Lab 8 Practice with Methods Write a program that has the following menu of optio
ID: 3538366 • Letter: L
Question
Lab 8
Practice with Methods
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 to complete the task, and pass it to a method.
///////////////////MENU///////////////////////////////
//1. Let%u2019s Draw Trees! (Optional 5 pts extra credit on lab grade if it works completely)
//2. Reverse words
//3. Print Vertical
//4. Add digits
//5. Furbish Translator
/////////////////////////////////////////////////////////
1. Tree drawing program as listed on page 185 Programming Projects #1. You will need to ask the user for the number of segments and the height of each segment.
: Write a program that produces images of Christmas trees as output. It should have a method with two parameters: one for the number of segments in the tree and one for the height of each segment. For example, the tree shown here on the left has three segments of height 4 and the one on the right has two segments of height 5:
* *
*** ***
***** *****
******* *******
*** *********
***** ***
******* *****
********* *******
***** *********
******* ***********
********* *
*********** *
* *******
*
*******
2. The Print Reverse Method listed on pg. 185 (Exercises)
:
3. The Print Vertical Method listed on pg. 185 (Exercises)
:
h
e
y
n
o
w
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
5. Using the Furbish online Dictionary, create a method that accepts a word in furbish and returns the English translation. The translation should print the returned value to the user, not the method. Use at least 10 words. The online dictionary can be found at http://www.furby.com/en_US/furbish-dictionary
Explanation / Answer
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.