Answer:
Explanation:
// Below is the code to draw parking lot only , i have also put the o/p of code.
import java.util.*;
import java.lang.*;
import java.io.*;
public class Linc
{
static int size=4;
static int numBoxes = 1; // one row.
static int height =(int) Math.pow(size, 2); //Just how many | will it have.
static int width = 2; // two boxes in a row
public static void main (String[] args) throws java.lang.Exception
{
top();
printHeight();
}
public static void top(){
for(int i = 0; i <= numBoxes*width;i++)
{
if(i%width == 0) {//When this happens we're in a new box.
System.out.print(" ");
System.out.print("____________");
}
else
System.out.print(" ");
}
System.out.println(); //Move to next line.
}
public static void printHeight(){
for(int j = 0; j < height;j++){
for(int i = 0; i <= numBoxes*width;i++)
{
if(i%width == 0) {
System.out.print("|"); //Whenever this happens we're in a new box.
System.out.print("____________");
}
else
System.out.print(" ");
}
System.out.print("|");
System.out.println(); //Move to next line.
}
}
}