Question: Write a program that asks the user to enter the size of a triangle to print on the screen. After getting this number, the program
Write a program that asks the user to enter the size of a triangle to print on the screen. After getting this number, the program should then print a triangle to the screen by printing a series of lines consisting of asterisks. The first line will have one asterisk. The second line will have two asterisks, and so on, with each line having one more asterisk than the previous line, up to the number entered by the user. After reaching the number entered by the user, on the next line, print one less asterisk and continue by decreasing the number of asterisks by one for each successive line until only one asterisk is printed. using methods.
the main program is cant allowed to print any asterisks to the screen. It must call on the one method, and let that method take care of the printing the triangle to the screen.
That one method cant print any asterisks to the screen. It must use the another method repetively to print the lines of asterisks to the screen. must use 2 loops
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
