78.3k views
2 votes
Assume that printStars is a function that takes one argument and returns no value. It prints a line of N stars (followed by a newline character) where N is the value of the argument received. Write a statement that invokes printStars to make a line of 35 stars.

User Alex Blex
by
6.8k points

1 Answer

0 votes

Answer:

printStars(35);

Step-by-step explanation:

public class Question {

public static void main(String args[]) {

printStars(35);

}

public static void printStars(int numberOfStars){

for(int i = 1; i <= numberOfStars; i++){

System.out.print("*");

}

System.out.print("\\");

}

}

User Arocks
by
7.4k points