/** This program is intended to be used with the book "Java 6 -- What Do You Want To Do?"
 * by Steven P. Warr and is distributed free of charge and without and expectations of remuneration.
 * Chapter BAS   NOTE all program names begin with the the title of the chapter in which
 * they are intended to be used.   Copyright 2008 Steven P. Warr All rights reserved
 */

import java.io.*;   		// needed so you can use the File class
import java.util.*;  		//needed for Scanner
public class Bas10
{
	public static void main(String[ ] args)
		{
			drawRectangle(15,20,6);
			drawRectangle(35,10,3);
			drawRectangle(55,24,5);
		}
			
public static void drawRectangle(int left, int width, int height) // NO semicolon
{
    String top =  "____________________________________";
    String bottom =  "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
	String space = "                                                                                ";
	System.out.print(space.substring(0,left));  //spaces on the left of the rectangle
	System.out.println(top.substring(0,width)); //top edge
	for(int x = 0;x < height; x++)  //If height  is 15, the code in the brace
		{			// block  repeats 15 times.
            	System.out.print(space.substring(0,left));  //spaces on the left	     	  
            	System.out.print("|");  //left vertical edge of the rectangle
			    System.out.print(space.substring(0,width-2)); //space between edges
			    System.out.println("|");//right vertical edge of the rectangle
		}
	System.out.print(space.substring(0,left));  //spaces on the left of the rectangle
	System.out.println(bottom.substring(0,width)); //bottom edge
}
}
