Write a program using java programing language. Write a Java class (called ShowNum) that displays the same number of asterisks (row and columns) as is input in 2 numbers. Your class should have a default constructor (number1 is 0, number2 is 0) and another constructor that inputs 2 numbers (integers). You'll need accessor methods for the numbers and a display method that displays as follows: Input: 2, 7 ******* ******* Demo the class in a client (called ShowNumClient) that allows the user to run the program as many times as they want (enter number and use display method). The user will signal with a sentinel (-1), when they want to terminate the client. Make sure that each number entered in the client is between 1 and 30.
Write a
Write a Java class (called ShowNum) that displays the same number of asterisks (row and columns) as is input in 2 numbers.
Your class should have a default constructor (number1 is 0, number2 is 0) and
another constructor that inputs 2 numbers (integers).
You'll need accessor methods for the numbers and a display method that displays as follows:
Input: 2, 7
*******
*******
Demo the class in a client (called ShowNumClient) that allows the user to run the program as many times as they want (enter number and use display method).
The user will signal with a sentinel (-1), when they want to terminate the client.
Make sure that each number entered in the client is between 1 and 30.

Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 5 images









