How to initialize a screen to a given size How to use an image as your background How to move the turtle to a given (x, y) position without drawing a line on the screen How to draw a circle, how to draw a square (we covered some of this in class) How to draw filled-in shapes with begin_fill() How to clear the screen after drawing In Python, the center of the screen is at (0, 0) by default. Your program should do the following: Draw a square with a length of 80. The center of your square should be at (0, 0). Use any color you want; in the example screen captures here, I’m using blue. Draw an inscribed circle in the square that was drawn in step 1. Use a different color for your circle. I used magenta but pick any color you like – other than what you used for your square. Due to the way Turtle draws lines and circles, you’ll likely need to experiment with your starting coordinates for your circle draw. Prompt the user for a new (x, y) coordinate for the square, and a new (x, y) coordinate for the circle. “Move” the shapes to their new positions by erasing the original square and circle, and drawing them in the location specified by the user. The redrawn shapes should be solid-filled with the color of your choice (the shapes’ center-points are specified by the information input by the user). Define any functions you need to make this all work. The “app window” is screen capture I saved to a png file, so your drawings might be a pixel or two shifted. That’s okay as long as the placement and movement seem reasonable from the (0, 0) origin you start at. You can assume the user gives you “good data”: values all within the Turtle coordinate system between 200 and -200. Notes: Consider the given .png image of the application window is 970x635 pixels, and that should be the starting size of your Turtle screen. If you don’t remember your geometry, an inscribed circle looks like this, and the diameter is equal to the length of the square’s side. Tips: It’s very difficult to test graphics-related functions without explicit test tools (screen-grabbers, functional test tools, etc.), so your most important job is to ensure your turtle movement and drawing is as consistent as possible. Of note, when you move the turtle, it has a directional heading (N/S/E/W). Take care to set the heading consistently to ensure repeatable drawing of the shapes. You can trust the user to give you good information, and to stay within the ±200 (the default bounds of the drawing canvas coordinates)
How to initialize a screen to a given size How to use an image as your background How to move the turtle to a given (x, y) position without drawing a line on the screen How to draw a circle, how to draw a square (we covered some of this in class) How to draw filled-in shapes with begin_fill() How to clear the screen after drawing In Python, the center of the screen is at (0, 0) by default. Your program should do the following: Draw a square with a length of 80. The center of your square should be at (0, 0). Use any color you want; in the example screen captures here, I’m using blue. Draw an inscribed circle in the square that was drawn in step 1. Use a different color for your circle. I used magenta but pick any color you like – other than what you used for your square. Due to the way Turtle draws lines and circles, you’ll likely need to experiment with your starting coordinates for your circle draw. Prompt the user for a new (x, y) coordinate for the square, and a new (x, y) coordinate for the circle. “Move” the shapes to their new positions by erasing the original square and circle, and drawing them in the location specified by the user. The redrawn shapes should be solid-filled with the color of your choice (the shapes’ center-points are specified by the information input by the user). Define any functions you need to make this all work. The “app window” is screen capture I saved to a png file, so your drawings might be a pixel or two shifted. That’s okay as long as the placement and movement seem reasonable from the (0, 0) origin you start at. You can assume the user gives you “good data”: values all within the Turtle coordinate system between 200 and -200. Notes: Consider the given .png image of the application window is 970x635 pixels, and that should be the starting size of your Turtle screen. If you don’t remember your geometry, an inscribed circle looks like this, and the diameter is equal to the length of the square’s side. Tips: It’s very difficult to test graphics-related functions without explicit test tools (screen-grabbers, functional test tools, etc.), so your most important job is to ensure your turtle movement and drawing is as consistent as possible. Of note, when you move the turtle, it has a directional heading (N/S/E/W). Take care to set the heading consistently to ensure repeatable drawing of the shapes. You can trust the user to give you good information, and to stay within the ±200 (the default bounds of the drawing canvas coordinates)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
- How to initialize a screen to a given size
- How to use an image as your background
- How to move the turtle to a given (x, y) position without drawing a line on the screen
- How to draw a circle, how to draw a square (we covered some of this in class)
- How to draw filled-in shapes with begin_fill()
- How to clear the screen after drawing
In Python, the center of the screen is at (0, 0) by default.
Your program should do the following:
- Draw a square with a length of 80. The center of your square should be at (0, 0). Use any color you want; in the example screen captures here, I’m using blue.
- Draw an inscribed circle in the square that was drawn in step 1. Use a different color for your circle. I used magenta but pick any color you like – other than what you used for your square. Due to the way Turtle draws lines and circles, you’ll likely need to experiment with your starting coordinates for your circle draw.
- Prompt the user for a new (x, y) coordinate for the square, and a new (x, y) coordinate for the circle.
- “Move” the shapes to their new positions by erasing the original square and circle, and drawing them in the location specified by the user. The redrawn shapes should be solid-filled with the color of your choice (the shapes’ center-points are specified by the information input by the user).
Define any functions you need to make this all work. The “app window” is screen capture I saved to a png file, so your drawings might be a pixel or two shifted. That’s okay as long as the placement and movement seem reasonable from the (0, 0) origin you start at.
You can assume the user gives you “good data”: values all within the Turtle coordinate system between 200 and -200.
Notes:
- Consider the given .png image of the application window is 970x635 pixels, and that should be the starting size of your Turtle screen.
- If you don’t remember your geometry, an inscribed circle looks like this, and the diameter is equal to the length of the square’s side.
Tips:
- It’s very difficult to test graphics-related functions without explicit test tools (screen-grabbers, functional test tools, etc.), so your most important job is to ensure your turtle movement and drawing is as consistent as possible. Of note, when you move the turtle, it has a directional heading (N/S/E/W). Take care to set the heading consistently to ensure repeatable drawing of the shapes.
- You can trust the user to give you good information, and to stay within the ±200 (the default bounds of the drawing canvas coordinates)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education