Question: Figure 12-20 earlier in this chapter shows the output of a program that displays any number of Os running diagonally from top left to bottom
Figure 12-20 earlier in this chapter shows the output of a program that displays any number of Os running diagonally from top left to bottom right. Now, write a program that prompts the user for a number of lines to display, and then use a recursive method to display Os from top right to bottom left. Figure 12-25 shows a sample execution. Save the program as OppositeDiagonal.java.
Data from in Figure 12-20

Data from in Figure 12-25

Figure 12-20 Two typical executions of the Diagonalos program How many lines to display? >> 5 0 0 0 0 0 How many lines to display? >> 8 0 0 0 0 0 0 0 0
Step by Step Solution
3.52 Rating (165 Votes )
There are 3 Steps involved in it
import javautilScanner public class Opposite Diagonal public static void mai... View full answer
Get step-by-step solutions from verified subject matter experts
