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

Your task is to write two programs that print the following drawing of one of th

ID: 3629813 • Letter: Y

Question

Your task is to write two programs that print the following drawing of one of the arched openings found on either side of Marsh Chapel:
(image that needs to be printed):
http://cs-people.bu.edu/dgs/courses/cs111/assignments/ps3/ps3_figure.gif

First version
The first version of your program should reproduce the drawing shown above without using a class constant for a scale factor. This initial version of your program will be similar to the initial DrawTorch program from lecture.
Your program should use for loops (including nested loops where appropriate) to print the drawing. Break the drawing into components -- groups of lines that follow the same pattern -- and write a separate method for each component. Use pseudocode and tables to figure out the patterns in the output. Test each method before moving on to the next one. The case studies from lecture (notes, examples) and from Chapter 2 of the textbook are good examples of this approach to drawing a complex figure.

In addition, you should follow these guidelines:

a. Put this version of your program in a class called DrawArchedOpening.
b. Each print/println statement should print at most two characters. An escape sequence like \ only counts as a single character.
c. Make sure that your program exactly reproduces the output shown above. This includes having identical characters and spacing. There should be no blank lines before or after the drawing, and no extra spaces to the left or right of a given line. When comparing your output to the expected output, you may find it helpful to consult the text file available here.
d.Do not use any programming constructs that are not in Chapters 1 through 2 of the textbook (the material covered in lecture up to and including the notes on definite loops). In particular, the methods that you write should not have any parameters.
e.Use procedural decomposition -- employing static methods to capture the structure of your solution and to eliminate code duplication -- as you did in Problem Set 1. Make sure that no substantial groups of repeated statements appear in your code.
f.Employ good programming style. Use appropriate indentation, select descriptive variable names, insert blank lines between logical parts of your program, and add comments as necessary to explain what your code does.

Explanation / Answer

please rate - thanks

import java.util.*;
public class DrawArchedOpening
{public static void main(String[] args)
{top();
middle();
bottom();
}

public static void middlepillars()
{int i;
for(i=0;i<6;i++)
   {pillarside();
    blanks();
    pillarside();
    System.out.println();
    }
}

public static void middle()
{arch();
middlepillars();
dashside();
blanks();
dashside();
System.out.println();
middlepillars();
}

public static void blanks()
{int i;
for(i=0;i<16;i++)
   System.out.print(" ");
}

public static void bottom()
{int i,j,k;
lineequal();
for(i=0;i<2;i++)
    {for(j=0;j<6;j++)
            {System.out.print("//");
            System.out.print("\\");
            }
    System.out.println();
    }
lineequal();
}

public static void lineequal()
{int i;
for(i=0;i<24;i++)
     System.out.print("=");
System.out.println();
}

public static void linecolon()
{int i;
for(i=0;i<24;i++)
     System.out.print(":");
System.out.println();
}

public static void top()
{int i,j;
for(j=0;j<2;j++)
   {lineequal();
    for(i=0;i<2;i++)
        linecolon();
    }
}

public static void arch()
{int i,j;
for(i=0;i<4;i++)
   {pillartop();
    for(j=0;j<3-i;j++)
         System.out.print("::");
    System.out.print("-/");
    for(j=0;j<4*i;j++)
         System.out.print(" ");
    System.out.print("\-");
        for(j=0;j<3-i;j++)
         System.out.print("::");
    pillartop();   
    System.out.println();
    }
}

public static void pillartop()
{int j;
for(j=0;j<2;j++)
         System.out.print("/");
for(j=0;j<2;j++)
         System.out.print("\");
}

public static void pillarside()
{int i;
for(i=0;i<4;i++)
     System.out.print("|");
}

public static void dashside()
{int i;
for(i=0;i<4;i++)
     System.out.print("-");
}


}