Question: public static void printLines( int n ) This method takes a positive integer n as it's parameter. Assume n is positive (no checking required). The
public static void printLines( int n ) This method takes a positive integer n as it's parameter. Assume n is positive (no checking required). The method will then produce n lines of output. Each line of output consists of the integers from 1 to n, but in the first line there are two 1's output in a row. In the second line there are two 2's output in a row. On the third line, there are two 3's output in a row, etc. Your output must be formatted exactly as shown in the sample run below, but your program must work for any positive integer n. For example, printlines 6 ) would produce the following output Line 1: 1123456 Line 2: 1223456 Line 3: 1233456 Line 4: 1234456 Line 5: 1234556 Line 6:1234566 As above, you may test your method with inputs of your choice in main, or you may leave main empty. Your method will be tested with inputs that produce known outputs. General Instructions: O Type here to search
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
