PART A. Write a program NumberShape that asks the user to enter a single-digit number and outputs the results as shown below using that number. Here are two examples (with user input shown in red):...


PART A. Write a program NumberShape that asks the user to enter a single-digit number and outputs the

results as shown below using that number. Here are two examples (with user input shown in red):

Enter a single-digit number:  ex: 4


     4

    4 4

  44 44

44 4 44





import java.util.Scanner


public class NumberShape
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Enter a single-digit: ");
int randomNumber = input.nextInt();


System.out.println(   randomNumber);

System.out.println(randomNumber randomNumber);
System.out.print( randomNumberrandomNumber randomNumberrandomNumber);
System.out.println(randomNumberrandomNumber randomNumber randomNumberrandomNumber);


}

}




Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here