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
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…
using paintComponent(Graphics g) Write a program in java that, for four points A, B, C and P, • draws a triangle formed by ABC and a small cross showing the position of P; • displays a line of text indicating which of the following three cases applies: P lies (a) inside ABC, (b) outside ABC, or (c) on an edge of ABC. The user will specify the four points by clicking. please don't copy from chegg, correct answer gets up voted thanks.
Image binarization converts a greyscale or a coloured image to a black and white image. Assume that you are given a greyscale image with text as shown in Figure 2 below. Write the Java program to convert the greyscale image to a black and white image. You may set your own estimated threshold value. A VILLAGE OF MORMONS-Over seven hun- dred Mormons reached this city from New York May 15th, and tarried with us till the early train westward set off this morning. There were enough of them to constitute a good sized village. Figure 2: Greyscale Text Image
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