Title : Simple House
Modules : 01 Programming Basics & 02 Java Basics
Point Value : 42 (project)
Deadline : Due before 11:00 pm on 24th September
Topics Covered:
Sequential algorithms, numerical data types, arithmetic operations, simple input, Sedgewick & Wayne drawing library.
Setting Things Up:
For this project, you will utilize the Sedgewick & Wayne drawing library which is a Java file named StdDraw.java. (We're using it during class in Week 2.) To download the file:
● Go to Blackboard and on the left menu click on "Programming Tools", then “Drawing Library”
● Using a right-click, download the Java file (i.e. the drawing library named 
StdDraw.java) into the same folder where you plan to save this project’s JAVA file.
● Click on the link named ‘documentation’ to view the documentation for the library.
Project Description:

There are many styles of houses around the world, and in this project you'll create a simple drawing of a classic two-story house, similar to the example shown in the image to the right.

Below we describe the specifications for the house with respect to room sizes, house dimensions, window and door sizes, and relative positions in the house and drawing canvas.

You will write a Java program to draw similar houses, customized according to user input indicating the total square footage of the house and the name of the family living in the house. Your program will also output the sizes of the main rooms in the house: living room, dining room, kitchen. These will be based on formulas for what percentage of the main floor each room consumes. We will assume that the footprint of the house is a square, and that the desired square footage is divided evenly between the 1st and 2nd floors. We are not concerned with including details such as closets and bathrooms.

The living room will run along one entire side of the house, consuming 45% of the perpendicular walls. The remaining 55% along the opposite side of the house will be part kitchen totalling 30% of the square footage on

the 1st floor, and part dining room for the remaining 25%. To the left is a sample floor plan, but other configurations are possible by choosing a different wall for the living room and swapping the relative positions of the kitchen and dining room.

Program Input:

There must be 2 types of interactive input to the program from the user (keyboard) that will determine the size of the house, and the text with which to name the house. Your program must clearly prompt for these values:
● An input integer will indicate the total square footage of the house (both floors combined, to be divided evenly between them). You can assume the input will be valid. See below for details on calculating the width and height of the rectangle representing the house. Your house drawing should occupy 80% of the width of the drawing canvas and be centered both horizontally and vertically. Therefore, you'll need to determine the size of the canvas based on the desired size of the house, and choose a ratio for converting the house dimensions from feet into pixels based on the canvas dimensions. We recommend multiplying feet by 10 in order to convert to pixels, and testing with house sizes >= 1000 sq. ft. (As a point of reference, the default window size when using StdDraw is 512x512 pixels.)

● An input phrase will serve as the name of the house, to appear below the drawing, centered in the display. This name should be appended to either "Casa" or "Chez" - your choice, capitalizing the first letter of the name, and preserving will determine the size of the house, and the text with which to name the house. Your program must clearly prompt for these values:

● An input integer will indicate the total square footage of the house (both floors combined, to be divided evenly between them). You can assume the input will be valid. See below for details on calculating the width and height of the rectangle

representing the house. Your house drawing should occupy 80% of the width of the drawing canvas and be centered both horizontally and vertically. Therefore, you'll need to determine the size of the canvas based on the desired size of the house, and choose a ratio for converting the house dimensions from feet into pixels based on the canvas dimensions. We recommend multiplying feet by 10 in order to convert to pixels, and testing with house sizes >= 1000 sq. ft. (As a point of reference, the default window size when using StdDraw is 512x512 pixels.)
● An input phrase will serve as the name of the house, to appear below the drawing, centered in the display. This name should be appended to either "Casa" or "Chez" - your choice, capitalizing the first letter of the name, and preserving 
the rest of the original capitalization. So for example, if the input phrase is "smith FaMiLy", the house might be labelled as "Casa Smith FaMiLy". Use an area the same height as the roof in order to display the text (so the house is vertically symmetric).
Drawing Details: Here are specifics regarding the elements that comprise the house drawing. Remember that these units of measurement might need to be converted to other values relative to
the canvas size.
● The height of the main house should be 18ft, 9 for each floor. The roof and area containing the text label below the house should each be 6 feet high. This combined height of 30 feet should be 80% of the canvas height.
● The width of the house must be calculated as the square root of the desired square footage for one floor. (Remember that both floors have the same square footage.) This house width should consume 80% of the width of your drawing canvas.
● Each house must be drawn with 3 windows across the second floor, evenly spaced. The width of each will be the width of the house divided by 7 so that the spaces next to the windows are the same width as the windows themselves. The height of each 2nd floor window should be 42 inches. The top of each window should be 1.5 feet from the top of the house wall. [For an optional extra challenge, draw the middle window as a circle using the minimum of the other
windows' width as the diameter.]
● The door should be 7 feet high and 3 feet wide, centered at the bottom of the house, and include a door knob appropriately placed.
● There should be two windows on the first floor, each 54 inches high. The width of each should be the (house width - door width) divided by 4. These should also be centered horizontally in the spaces next to the door, but be placed 3 feet up from the bottom edge of the house.
● You may choose the color of the house and the roof according to your preferences, but they must not be the same. The roof outline should also be a different color than the roof eaves and the house wall. The house should be sitting on a green line that extends the entire canvas (like grass). The house label should be the same color as the roof outline. (This might not always be obvious from visual inspection due to different line widths, such as in our example.)
● The door color should be different from the house color and different from white, and all except the bottom edge should be outlined in white. (The bottom edge of the door should be green like the house edge.)

● The windows should all be outlined in white and filled with gray. For an optional extra challenge, feel free to add white mullions (crossbars) to them.

Program output:

In addition to producing the drawing, your program must also output text (in the jGRASP Run I/O window) that provides the dimensions in feet of the three main living spaces - living room, dining room, and kitchen, appropriately labelled. Run I/O window) that provides the dimensions in feet of the three main living spaces - living room, dining room, and kitchen, appropriately labelled.

Some helpful details:
● Many colors are available as pre-defined values in StdDraw.java. While using the StdDraw.java library you may find it useful to consult this online documentation. You do have the option to create/use custom colors as well.
● A sample run showing the input, text output, and resulting graphic with the final look we expect for full credit is shown below. 
General Project (Hard) Requirements:
● You will receive a 0 for any code that does not compile!
● Your solution must be named Proj1.java (capitalization matters!).
● Your file
must have a javadoc style class comment that explains briefly the purpose of the program, the author’s name, JHED, and the date.
● The program must be fully checkstyle-compliant using our course required 
check112.xml configuration file. This means the checkstyle audit completes without reporting any errors or warnings.
● You must also use good style with respect to class/method/variable names, etc.
● Submit
only the .java file named Proj1.java to the Project 1 assignment on Gradescope before the deadline date.
● You must submit the code before the deadline - no exceptions! You can resubmit as many times as you want before the deadline - we will only grade your final (most recent) submission.
Grading Breakdown:
● [36] Functionality (only if it compiles)
● [4] Style (only if it compiles)
● [2] Submission & (no) run-time errors (only if it compiles)
IMPORTANT: Assignments that don’t compile get a 0 grade!