Answer:
The following are the program in the Java Programming Language.
//define a function
public void dashedLine (int x)
{
//check the variable 'a' is greater than 0
if (x>0)
{
//declare integer data type variable
int i;
//set the for loop that iterates from 1 to variable 'a'
for (i=1;i<=x;i=i+1)
{
//print the following dashes
System.out.print("-");
}
//for empty space
System.out.println("");
}
}
Explanation:
The following are the description of the program.
interquarile range
I found everything easy, but some parts tripped me up.
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
Hint: You will need to create a variable that controls how far the * is from edge of the console. That variable should change size each iteration through the outer loop!
public class JavaApplication82 {
public static void main(String[] args) {
for (int i = 1; i <= 9; i++){
for (int w = 0; w < i; w++){
System.out.print("*");
}
System.out.println("");
}
}
}
This works for me.