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

Videos

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

Program to draw concentric rings

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.
    • Using the method Circle(), draw the circle.
    • Using the method setOutline(), set the outline of the object to the given color.
    • Using the method setFill(), set the interior of the object to the given color.
    • Using the method setWidth(), set the width of the outline of the object to the desired number of pixels.
    • Using the method draw(), draw the square inside the graphics window.
    • Use the same methodology for drawing other colors in the graphics window.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
Computer Science IN PYTHON(visual studio code) program a simple flag that consists of at least two shapes while only using rectangles and circles. Give it a flagpole by drawing a long skinny rectangle next to it. Wave the flag by animating it up and down. (make the Swedish and UK flag)   import pgzero
See the sample outputs for more clarification. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Programmer's full name Project number Project due date Processing Requirements Use the following template to start your project: #include using namespace std; // Global constants // The number of rows in the array // The number of columns in the array // The value of the smallest number // The value of the largest number const int ROWS = 3; const int COLS = 3; const int MIN = 1; const int MAX = 9; // Function prototypes bool isMagicsquare(int arrayRow1[], int arrayRow2 [], int arrayRow3[], int size); bool checkRange (int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max); bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size); bool checkRowSum (int arrayrow1[], int arrayrow2[], int arrayrow3[], int size); bool checkColiSum(int arrayrow1[], int…
Problem: Bugs are simple creatures that only know how to walk towards other bugs. Bugs maintain information about their (x, y) position; by which it can tell if they are standing next to other bugs. Watch the following video: bug movement. Create a java project that simulate bugs movement. You need to write a class “Bug" that models a bug moving along a straight line and it can turn to change its direction counterclockwise (i.e. 90 degree to the left; north → west → south → east → north). In each move, its position changes by one unit in the current direction. Details of the "Bug" class is described below. Your simulator should read information of an unknown number of “Bug" objects from an input file called “Bugs.txt". Each line represents a bug and the initial position and facing direction of this particular bug. Keeping the first bug position as a reference the simulator should move the second bug next to the first bug forming a cluster and its final position and direction should be…
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
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781305480537
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY