Question
Five Click House (Python Programming) This is what I have so far. I do not know where to go from here. Please help me finish
Five Click House (Python Programming)
This is what I have so far. I do not know where to go from here. Please help me finish this coding assignment and explain the steps because I am new to programming!
from graphics import Point, GraphWin, Polygon, Text, Rectangle, Line
def main():
# Setting up Window win = GraphWin("House", 500, 500) win.setCoords(0, 0, 499, 499) win.setBackground("light cyan")
# Creating Frame of House (Rectangle) instr = Text(Point(250, 30), "Create the base of the house by clicking in the upper left corner and the lower right corner to build the frame.") instr.setSize(10) instr.draw(win) p1 = win.getMouse() p1.draw(win) p2 = win.getMouse() p2.draw(win) frame = Rectangle(p1, p2) frame.draw(win)
# Drawing Door instr.setText("Click where you would like the center of the top of the door frame to be.") instr.setSize(10) instr.draw(win)
11. Five-click House. You are to write a program that allows the user to draw a simple house using five mouse clicks. The first two clicks will be the opposite corners of the rectangular frame of the house. The third click will indicate the center of the top edge of a rectangular door. The door should have a total width that is 1 of the width of the house frame. The sides of the door should extend from the corners of the top down to the bottom of the frame. The fourth click will indicate the center of a square window. The window is half as wide as the door. The last click will indicate the peak of the roof. The edges of the roof will extend from the point at the peak to the corners of the top edge of the house frame. 2 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started