Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 public class StarsNumbers { 3 4 5 60 7 8 9 10 11 12 13} 14 public static void main(String args[]) { patternDown();
1 public class StarsNumbers { 3 4 5 60 7 8 9 10 11 12 13} 14 public static void main(String args[]) { patternDown(); patternUp(); } public static void patternDown() { for (int i = 1; i = 1; i--) { for (int j = 1; j = i; k--) { System.out.print(k); } System.out.println(); 27} 28 Upload StarsNumbers.java with a main method as below: main calls two methods, patternDown(); and patternUp(); that produces output of pattern of stars and numbers as shown below. methods MUST use nested loops public static void main(String args[]) { } patternDown(); // write nested loop to print 5 top lines as shown below patternUp(); // write another nested loop, omit the line with single number 1 so it's shared // your complete code will follow.... } Hint: See if you can simply modify the code in pattern Down method to get the code for patternUp method. Desired output is shown below: **123456789** ***1234567*** ****12345**** *****123***** ****** *****123***** ****12345**** ***1234567*** **123456789**
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started