Write a pseudocode algorithm that will produce the following figure as output:
+===+===+
| | |
| | |
| | |
+===+===+
| | |
| | |
| | |
+===+===+
The following pseudocode algorithm that will produce the given figure as output:
System.out.println("+===+===+");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("+===+===+");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("+===+===+");
Complete Executable program code:
//Main class name, DisplayDiagram
public class DisplayDiagram
{
//Program beigns from the main method
public static void main(String[] args)
{
//Print given diagram
System.out.println("+===+===+");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("+===+===+");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("| | |");
System.out.println("+===+===+");
}
}
Output of the program code:
+===+===+
| | |
| | |
| | |
+===+===+
| | |
| | |
| | |
+===+===+