Question: In this lab, you add nested loops to a Java program provided. The program should print the letter E , as shown below. The letter

In this lab, you add nested loops to a Java program provided. The program should print the letter E, as shown below. The letter E is printed using asterisks, three across and five down. Note this program uses System.out.print("*"); to print an asterisk and System.out.print(""); to print a space.
public class LetterE
{
public static void main(String args[])
{
final int NUM_ACROSS =3; // Number of asterisks to print across.
final int NUM_DOWN =5; // Number of asterisks to print down.
int row; // Loop control for row number.
int column; // Loop control for column number.
// Write a loop to control the number of rows.
// Write a loop to control the number of columns
// Decide when to print an asterisk in every column.
System.out.print("*");
// Decide when to print asterisk in column 1.
System.out.print("*");
// Decide when to print a space instead of an asterisk.
System.out.print("");
// Figure out where to place this statement that prints a newline.
System.out.println();
}
}// End of LetterE class.

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 Programming Questions!