Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 4, Problem 11PE
Program Plan Intro

Program to draw a House

Program plan:

  • Import the required graphics package.
  • Define the main method.
    • Using the object GraphWin(), to display the graphics window.
    • Using the method setCoords(), set the size of the graphics window.
    • Prompt the user for 2 mouse clicks to draw the frame of the house.
    • Prompt the user for 3rd click to draw the door.
    • Prompt the user for 4th click to draw the window in square shape.
    • Prompt the user for 5th click to draw the roof
    • Store coordinates in variables x1, x2, x3, y1, y2, and y3.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
JAVA CODE PLS  Rectangle by CodeChum Admin A rectangle can be formed given two points, the top left point and the bottom right point. Assuming that the top left corner of the console is point (0,0), the bottom right corner of the console is point (MAX, MAX) and given two points (all "x" and "y" coordinates are positive), you should be able to draw the rectangle in the correct location, determine if it is a square or a rectangle, and compute for its area, perimeter and center point.   To be able to do this, you should create a class for a point (that has an x-coordinate and a y-coordinate). Also, create another class called Rectangle. The Rectangle should have 2 points, the top left and the bottom right. You should also implement the following methods for the Rectangle: display() - draws the rectangle on the console based on the sample area() - computes and returns the area of a given rectangle perimeter() - computes and returns the perimeter of a given rectangle centerPoint() -…
Computer Science create a jumping rectangle, create a second rectangle that move back and forth across the bottom (yLimit) and allow the jumping rectangle to move left and right too. The jumping box must avoid a collision with the second rectangle, if they hit a message should be shown that you died and end the program. in C#
The following program moves a robot in a grid of squares. The initial position and direction of the robot is shown below. Click on the grid to move the robot to the final position after the program is run. You must click within the box to rotate the robot to the correct final direction (click near the top of the box to rotate up, etc...) Feel free to move the robot along as you follow the code. PROCEDURE DoSomething(a){    MOVE_FORWARD()    if( a > 2 )    {        MOVE_FORWARD()    }    else    {        if( a = 3 )        {            MOVE_FORWARD()        }    }    MOVE_FORWARD()} i ⬅ 3ROTATE_RIGHT()REPEAT 2 TIMES{    DoSomething(i)    MOVE_FORWARD()    ROTATE_RIGHT()    i ⬅ i - 1}
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Expressions in C++ | C++ tutorial for beginners; Author: Tutorial Mart;https://www.youtube.com/watch?v=XHbsZGpmRc8;License: Standard YouTube License, CC-BY
expression in python # python expressions; Author: Abhishek Tripathi;https://www.youtube.com/watch?v=Cc-kJGRjH6k;License: Standard Youtube License