Write a function house that takes three parameters: the width w of the house (a float),...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function house that takes three parameters: the width w of the house (a float), the height h of the house (a float), and the bottom left corner c of the house (a tuple of two floats). The corner is represented in turtle coordinates (so the origin (0,0) is the center of the screen). You may assume that c will be chosen to lie on the screen, and that the house will fit on the screen. You may interpret height as either the height to the bottom of the roof or to the top of the roof. The structure and style of the house is up to you, but, for full credit, it must contain the following elements, each of which will be drawn using a helper function, called from the main house function: - a roof - windows (at least 4) - a front door - a chimney - a lawn in front of the house - a path to the front door - a sun or moon in the sky If you are so inspired, feel free to add other elements. The parameters of these functions are up to you. Each element (door, window, sun, ...) must be a different colour. The background colour of the house walls must be a different colour than the elements. (Each window can be the same colour as the other windows.) You may choose the parameters you pass to each function that draws an element. You must use turtle graphics, so you must use the turtle module. If you wish, you may use any other module that we have covered in class (random, math, numpy). Write a function house that takes three parameters: the width w of the house (a float), the height h of the house (a float), and the bottom left corner c of the house (a tuple of two floats). The corner is represented in turtle coordinates (so the origin (0,0) is the center of the screen). You may assume that c will be chosen to lie on the screen, and that the house will fit on the screen. You may interpret height as either the height to the bottom of the roof or to the top of the roof. The structure and style of the house is up to you, but, for full credit, it must contain the following elements, each of which will be drawn using a helper function, called from the main house function: - a roof - windows (at least 4) - a front door - a chimney - a lawn in front of the house - a path to the front door - a sun or moon in the sky If you are so inspired, feel free to add other elements. The parameters of these functions are up to you. Each element (door, window, sun, ...) must be a different colour. The background colour of the house walls must be a different colour than the elements. (Each window can be the same colour as the other windows.) You may choose the parameters you pass to each function that draws an element. You must use turtle graphics, so you must use the turtle module. If you wish, you may use any other module that we have covered in class (random, math, numpy).
Expert Answer:
Answer rating: 100% (QA)
Creating a function to draw a house with the specified elements using the Turtle graphics library is ... View the full answer
Related Book For
Data Structures And Algorithms In C++
ISBN: 9780470383278
2nd Edition
Authors: Michael T. Goodrich, Roberto Tamassia, David M. Mount
Posted Date:
Students also viewed these programming questions
-
Jennifer is considering two offers on her apartment in Summerland. The first offer is $401937.4 which includes 10% down, 45% to be paid in 1 year and the remainder to be paid in 2.5 years. The second...
-
Provide three (3) examples of how you can incorporate diversity into a learning program to support inclusion and build on children's diverse backgrounds
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Establish procedures to guarantee substantiation of claims for allowances. Think about how you would set up a process to ensure employee claims and allowances could be claimed. Write a step by step...
-
We have all complained that there arent enough hours in a day. In an attempt to change that, suppose that all the people in the world line up at the equator, and all start running east at 2.50 m/s...
-
Suppose a decision maker faced with four decision alternatives and four states of nature develops the profit-payoff table shown as follows: a. If the decision maker knows nothing about the chances or...
-
A brand of bearings has a mean life span of 15,000 cycles, with a standard deviation of 1,250 cycles. Assume the life spans of the bearings have a bell-shaped distribution. (a) The life spans of...
-
Following are two years of income statements and balance sheets for the Munich Exports Corporation. A. Calculate the cash build, cash burn, and net cash burn or build for Munich Exports in 2010. B....
-
Managers often use variance analysis in employee performance evaluations for the following two attributeseffectiveness and efficiency. Variance analysis alerts management to whether the organization...
-
Required Identify and discuss any professional conduct issues in the following independent scenarios. (a) Adnan is a certified general accountant working for a national firm. He is at his desk when...
-
The sandwich company, Alamo Lone Star (ALS) prepares sandwiches for sale in vending machines in a large number of locations in an urban area. The four types of sandwich that are now provided are...
-
In what ways do poets utilize symbolic imagery to transcend literal representation and evoke profound emotional and philosophical insights ?
-
9. Read the following algorithm and answer the following questions. int function(int n) if (n == 1) return 1 return n + function (n - 1) a. What is the algorithm's purpose? In other words, what would...
-
Who is the end-user for the transaction online banking?
-
For your final assignment, please finish a short reflection of your speaking abilities in various organizational settings that you might find yourself in. Reflect on your strengths and weaknesses as...
-
what is social loafing and what does it involve in social psychology?
-
Excessive blood loss can be rectified by blood transfusion in which blood from one person donor, is transferred into the patients blood stream. Complete the table. (i) Group A B AB O Can donate blood...
-
Write a function that reads a Float24_t value: Float24_t float24_read(void) A legitimate float24 value string is of the form: "mantissabexponent" where the mantissa (m) and the exponent (e) may have...
-
Show that if d(n) is O( (n)) and e(n) is O(g(n)), then d(n)e(n) is not necessarily O( (n)g(n)).
-
Show that the probability that any given input element x belongs to more than 2log n subproblems in size group i, for randomized quick-sort, is at most 1/n 2 .
-
Suppose we have an nn two-dimensional array A that we want to use to store integers, but we dont want to spend the O(n 2 ) work to initialize it to all 0s, because we already know that we are only...
-
List five advantages of analysis pattern.
-
What are the classes and patterns involved in defining the stable pattern for analyses?
-
List some nonfunctional requirements that make up this pattern. Do you agree that they are different from the concept of analysis?
Study smarter with the SolutionInn App