Question: In this assignment, you will extend the existing turtle graphics program from class ( Week 6 - Example 3 ) that draws a house by

In this assignment, you will extend the existing turtle graphics program from class (Week 6- Example 3) that draws a house by adding a garden scene. Each element (sun, trees, pathway, flowers) must be implemented in a separate function. The original functions (except for initialization) cannot be modified, and each function must include pre-conditions and post-conditions.
New Drawing Elements
1. Sun: Draw a yellow circle in the sky with rays extending outwards.
- Function: draw_sun()
2. Trees: Draw two trees next to the house. Each tree should consist of a rectangle for the trunk and a circle or triangle for the foliage.
- Function: draw_tree(x, y)
3. Pathway: Add a pathway leading from the door using rectangles.
- Function: draw_pathway()
4. Flowers: Draw small flowers along the pathway (circles for petals and a line for the stem). Use fill_color() to use color.
- Function: draw_flower(x, y, color)
5. Explanation:
-\( x \) defines how far left or right the turtle will move to start drawing the object.
-\( y \) defines how far up or down the turtle will move to start drawing the object.
These coordinates allow you to place multiple trees or flowers in different locations by specifying the appropriate x and y values when calling the function.
In this assignment, you will extend the existing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!