Question: Assume we have defined a variable variable of type int called numAsterisks with the following line of code: int numAsterisks = ???; // numAsterisks can

Assume we have defined a variable variable of type int called numAsterisks with the following line of code:

int numAsterisks = ???; // numAsterisks can have any value

TASK: Print out a row of asterisks (i.e. the character '*'). The number of asterisks printed should be equal to the value of numAsterisks.

EXAMPLE: If numAsterisks is 5, you would print the following:

*****

NOTE: You do not need to create a class or a main method. We have done that behind the scenes.

Sample Input 1:

5

Sample Output 1:

*****

Sample Input 2:

8

Sample Output 2:

********

PLEASE ANSWER IN JAVA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!