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
Get step-by-step solutions from verified subject matter experts
