Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Module 3 Assignment #2 Instructions Upon completion of reading the chapters for

ID: 3915742 • Letter: M

Question

Module 3 Assignment #2 Instructions Upon completion of reading the chapters for this module, students will complete Lab 5-5: Nesting Loops on pages 90 and 91 in the Java Programming textbook. Remember to download the LetterE.java file and modify where indicated in the instructions. In this assignment, students will submit both the java and the class files for the completed program. Also include screenshot of your program execution similar to the sample output below. The program will be submitted by the posted due date using the appropriate dropbox. Sample output: GRASP exec: java LetterE jGRASP: operation complete.

Explanation / Answer

This program prints the E with 3 astrisks across and 5 astrisks down.

public class LetterE{

public static void main(String []args){
  
final int NUM_ACROSS = 3;
final int NUM_DOWN = 5;
  
int row;
int column;
  
for(row=0; row<NUM_DOWN; row++)
{
for(column = 0; column<NUM_ACROSS; column++)
{
if(row%2==0)
System.out.print("*");
else if(column==1)
System.out.print("*");
else
System.out.print("");
}
System.out.println();
}
System.exit(0);
}
}

This program prints the E with 5 astrisks across and 7 astrisks down.

public class LetterE{

public static void main(String []args){
  
final int NUM_ACROSS = 5;
final int NUM_DOWN = 7;
  
int row;
int column;
  
for(row=0; row<NUM_DOWN; row++)
{
for(column = 0; column<NUM_ACROSS; column++)
{
if(row%3==0)
System.out.print("*");
else if(column==1)
System.out.print("*");
else
System.out.print("");
}
System.out.println();
}
System.exit(0);
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote