Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that displays a checkered pattern of alternating blue and green squares. The colors should alternate in both the vertical and horizontal directions:

Write a program that displays a checkered pattern of alternating blue and green squares. The colors should alternate in both the vertical and horizontal directions: it doesnt matter what the starting color (whichever cell you choose) is. The size and number of squares are input by the user. The required interaction is given below.
1)draw_square()withfourparameters.Thisfunctiondraws a single square at specified location with a certain size and filled with a certain color.
a) x the x cordinate of the point where the square is to be placed
b) y the y coordinate of the point where the square is to be placed
c) width, the length of the side of the square, and
d) color, the color to be used to filling the square
2) draw_patternwithtwoparameters.This function calls draw_square()todrawacer
a) width the length of the side of the smaller square and
b) number of squares , the number of squares in each row column
3) main() with no parameter. The function gets the number of squares and the length of the side from the user and calls the function draw_ pattern()
Enter the width of the smaller squares : 30
Enter the number of squares : 9
image text in transcribed
Enter the width of the smaller squares: 30 Enter the number of squares: 9 hould not he show n. Use a single turtle. The programs di

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago