Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java class (called ShowNum ) that displays the same number of asterisks (row and columns) as is input in 2 numbers. Your class

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 ******* *******

Create the UML to show all of the class members.

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.

Make sure to call both constructors from your client class.

Remember: The client class (ShowNumClient.java) is the one with the main method and runs/demo the class (ShowNum.java) . The class with no main only consists of instance variables and their methods. In order to call those methods from the class withthe main method we have to instantiate/create an object of the class ShowNum in the client class and then use that object to call the methods of the class ShowNum using the dot operator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

ip address 1 3 5 . 1 2 4 . 9 1 . 6 7 - private or public

Answered: 1 week ago