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
Question
Book Icon
Chapter 10, Problem 15PE
Program Plan Intro

Cannonball animation

Program Plan:

Tracker.py:

  • Import the required packages.
  • Definition of class “Tracker”.
    • Condition to show the ball in the window.
    • Create an object to report the current position.
    • Condition to track the X and Y position.
    • Calling the Point using the position.
    • Determining the size.
    • Call the method Circle.
  • Definition of method “initializeTracker ()”.
    • Get the size of the ball.
    • Setting the color of the ball.
    • Draw the window.
  • Definition of method “move”.
    • Tracking the current position.
    • Call the method Point by passing the parameter.
    • Call the method “initializeTracker()”.
  • Definition of “getPosition()”.
    • Return the center value

Main.py:

  • Import the require packages.
  • Definition of method “main()”.
    • Create an interface.
    • Call the method “Tracker()”.
    • Check the condition “getY” greater than or equal to “0”.
      • Call the update method.
      • Get the “x” and “y” position.
      • Move the ball.
      • Print the position.
  • Call the main method.

Blurred answer
Students have asked these similar questions
Of the five primary components of an information system (hardware, software, data, people, process), which do you think is the most important to the success of a business organization? Part A - Define each primary component of the information system. Part B - Include your perspective on why your selection is most important. Part C - Provide an example from your personal experience to support your answer.
Management Information Systems
Q2/find the transfer function C/R for the system shown in the figure Re ད
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning