Can you show me how to fill in the provided slots so the resulting code fragment
ID: 3661339 • Letter: C
Question
Can you show me how to fill in the provided slots so the resulting code fragment satisfies the given requirement(s). Note: you may leave any particular slot empty-if it leaves legal java code. You may also add more statements; However you can NOT change or delete any of the given code.
Requirments: print the following specific pattern to the output console.
//Start
******
__*****//ignore underscorring, spacing was being deleted when I post.
____***//spacing was deleting.
______**
________*
for (int k = _____; _____; ______)
{
_____________________________________
for (int j=_____; _____; ______)
{
System.out.print ('*');
______________________________________
}
_________________________________________
}//End
Explanation / Answer
import java.io.*; public class AsteriskPattern { static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { //Request number of rows and columns System.out.print("How many rows and columns do you want? "); int size = Integer.parseInt(keyboard.readLine()); //Loop over all rows for(int row = 0; rowRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.