Python Programming: An Introduction to Computer Science
3rd Edition
ISBN: 9781590282779
Author: John Zelle
Publisher: Franklin Beedle & Associates
expand_more
expand_more
format_list_bulleted
Question
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.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
in python code modify the cannonball animation so that the input dialog window stays on screen at all times
Find 10 sound effects from anywhere and create a screen in Processing divided into 10 rectangles. Each rectangle should be labeled with the name of the sound. When you click the rectangle, it should play the sound.
Put up screenshot with code
Chapter 10 Solutions
Python Programming: An Introduction to Computer Science
Ch. 10 - Prob. 1TFCh. 10 - Prob. 2TFCh. 10 - Prob. 3TFCh. 10 - Prob. 4TFCh. 10 - Prob. 5TFCh. 10 - Prob. 6TFCh. 10 - Prob. 7TFCh. 10 - Prob. 8TFCh. 10 - Prob. 9TFCh. 10 - Prob. 10TF
Ch. 10 - Prob. 1MCCh. 10 - Prob. 2MCCh. 10 - Prob. 3MCCh. 10 - Prob. 4MCCh. 10 - Prob. 5MCCh. 10 - Prob. 6MCCh. 10 - Prob. 7MCCh. 10 - Prob. 8MCCh. 10 - Prob. 9MCCh. 10 - Prob. 10MCCh. 10 - Prob. 1DCh. 10 - Prob. 3DCh. 10 - Prob. 1PECh. 10 - Prob. 2PECh. 10 - Prob. 3PECh. 10 - Prob. 4PECh. 10 - Prob. 5PECh. 10 - Prob. 6PECh. 10 - Prob. 7PECh. 10 - Prob. 8PECh. 10 - Prob. 9PECh. 10 - Prob. 10PECh. 10 - Prob. 11PECh. 10 - Prob. 13PECh. 10 - Prob. 15PECh. 10 - Prob. 16PE
Knowledge Booster
Similar questions
- What happens when you open a picture and then change the frame size? What happens if you open a picture after resizing the frame to the desired dimensions?arrow_forwardUsing simple JavaFX (No FXML), create a shape that can be dragged with the mouse cursor around the window. The color of this shape should change smoothly depending on its X and Y coordinates. There should also be a label that displays the coordinates of the shape in real-time.arrow_forwardUse a Canvas widget to draw each of the planets of our solar system. Draw the sun first, theneach planet according to distance from the sun (Mercury, Venus, Earth, Mars, Jupiter Saturn,Uranus, Neptune, and the dwarf planet, Pluto). Label each planet using the create_textmethod.arrow_forward
- How is it decided what image from the ImageList will be shown in the PictureBox, and what value is used to make that decision?arrow_forwardANDROID STUDIO: JAVA (NOT KOTLIN) This must be done inside of Fragment with tab layout. The design of the tab: a. any image b. Add two thumbnails at top corners of the image above c. Allow the user to draw on screen, allow the user to select the pen thickness and color (give 3 options each), with a button to update the pen properties. d. Button to clear the drawing.arrow_forwardCreate a transformation program that includes four images. When the user hovers over an image, the size of the image should increase by 20%.arrow_forward
- Design the wireframes and storyboard, interactivity diagram, object dictionary, and any necassary scripts for an interactive program for customers of Fortune's vacation Resort. Allow customers the option of choosing a studio, one bedroom, or two bedroom cabin, each of which costs a different weekly rental amount. Also allow the option of lake view, which increases the rental fee. The total fee is displayed when the user clicks a Reserve Cabin button.arrow_forwardA transformation is a process use to modify the object locations, size and orientations. Based on the image shown in Figure below, calculate the value for triangle points, B after it changes from A. Using P1, P2 and P3 as a label for triangle A points, show all triangle points used for your calculations. [Note: you can use any value for your x and y-axis scales, but state in your answer the value used] а) A Triangle transformation b) Write an OpenGL code to display the following output changes.arrow_forwardusing only pygame and nested for loops how do you make a module that gives an image a warm tone (scaling R values up and B values down)?arrow_forward
- The parameter is incorrect. The picture size is not supported. Each image must have a resolution of 40 to 2600 pixels.arrow_forwardUsing Tkinter graphics, create the window with the three buttons. Then, add action/ event to each button to draw the corresponding shapes using turtle graphics.arrow_forwardCreate a JavaFX application that displays a similar picture. You can use your own color palette. You do not have to match sizes exactly. You are free to add more details, but do not forget to print your name at the lower right angle.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you