Question: Please answer all three tasks in JAVA The examples below show two typical executions of a program that displays a triangle. Create the TriangleRecursive program

Please answer all three tasks in JAVA
The examples below show two typical executions of a program that displays a triangle. Create the TriangleRecursive program by prompting the user for a number of lines to display. The first row of the output contains the number of spaces that equals the number of lines that will eventually display. Pass the final number of lines, the current line number, the spaces to display, and the number of letters to display to a recursive method. The base case occurs when the current line equals the total number of lines to display. If the total number of lines has not yet been displayed, reduce the number of spaces, increase the number of letters, increase the current line number, and call the method again.
Examples of the program are shown below:
How many lines to display? \(\gg 3\)
T
TTT
TTTIT
Task 1: Created the TriangleRecursive class.
Task 2: The TriangleRecursive class contains the drawTriangle() method.
Task 3: The TriangleRecursive program displays the correct number of lines.
1
Please answer all three tasks in JAVA The

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!