Question: code so far and the mistakes. please fix Homework 1-3 Textbook Section 5.17 Write a Java program that prompts the user for an int n.

Homework 1-3 Textbook Section 5.17 Write a Java program that prompts the user for an int n. You can assume that 1 5 should use embedded for loops that produce the following output: 5 9. Your program 21 321 4321 54321 n... 54 3 2 1 Your prompt to the user should be: Please enter a number 1...9: Please note that your class should be named Pattern Two. import java.util.Scanner; class Pattern Two { public static void main(String args[]) Scanner input=new Scanner(System.in); int n=0,i=0,j=0,k=0; System.out.println("Please enter a number 1...9: n=input.nextInt(); for(i=1;ii;j--) System.out.print(" "); for(; j>0;j--) System.out.print(j); System.out.println(); Please enter a number 1...9: Your output 21 321 Please enter a number 1...9: Expected output 4: Compare output A Output is nearly correct; but whitespace differs. See highlights below. Special character in Input 0 number 1...9: Your output N N w N e a number 1.. Expected output 5: Compare output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
