Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 13.9, Problem 22CP
- 13.22 What Canvas widget methods would you use to draw each of the following types of shapes?
a. A circle
b. A square
c. A rectangle
d. A closed six-sided shape
e. An ellipse
f. An arc
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Computer graphics is a useful method or tool for creating charts, diagrams, drawings, and other sorts of computer-generated visuals.Write a one-page report (1.5 line spacing) regarding the above.
C.
Create a "Magic 8 Ball" Java program with a GUI using JavaFX.
Minimum requirements:
Use at least one layout pane to organize and contain nodes (e.g. Pane, Stack Pane, Flow Pane, Grid Pane, Border Pane, HBox, VBox)
Use at least two graphics elements (e.g. shapes or images). Make some of your shapes filled and others unfilled. Both shapes must be different.
Use at least three JavaFX User Interface (UI) controls (e.g. Label, Button, Check Box, Test Field, Text Area, Combo Box, List View, Scroll Bar, Slider. At least two of the three must be different.
Use at least two common “set” properties or methods for nodes (e.g. setTitle (for Stage), setFill or setFont (for Text), setValue (for ComboBox)
Use at least two common “get” properties or methods for nodes (e.g. getValue (for ComboBox), getText (for TextField))
Handle at least one user generated event (e.g. button click, mouse click, etc.)
Exercise#2:
Calculate the area and perimeter of right angled triangle.
Chapter 13 Solutions
Starting Out with Python (4th Edition)
Ch. 13.1 - What is a user interface?Ch. 13.1 - How does a command line interface work?Ch. 13.1 - Prob. 3CPCh. 13.1 - Prob. 4CPCh. 13.2 - Briefly describe each of the following tkinter...Ch. 13.2 - Prob. 6CPCh. 13.2 - Prob. 7CPCh. 13.3 - Prob. 8CPCh. 13.3 - Prob. 9CPCh. 13.3 - Prob. 10CP
Ch. 13.7 - Prob. 11CPCh. 13.7 - Prob. 12CPCh. 13.7 - Prob. 13CPCh. 13.7 - Prob. 14CPCh. 13.8 - You want the user to be able to select only one...Ch. 13.8 - You want the user to be able to select any number...Ch. 13.8 - How can you use an Intvar object to determine...Ch. 13.8 - Prob. 18CPCh. 13.9 - In the Canvas widgets screen coordinate system,...Ch. 13.9 - Using the Canvas widgets screen coordinate system...Ch. 13.9 - How is the Canvas widget's screen coordinate...Ch. 13.9 - 13.22 What Canvas widget methods would you use to...Ch. 13 - The ________ is the part of a computer with which...Ch. 13 - Before GUIs became popular, the interface was the...Ch. 13 - A ________ is a small window that displays...Ch. 13 - Prob. 4MCCh. 13 - An item that appears in a programs graphical user...Ch. 13 - You can use this module in Python to create GUI...Ch. 13 - Prob. 7MCCh. 13 - Prob. 8MCCh. 13 - This widget is a container that can hold other...Ch. 13 - Prob. 10MCCh. 13 - A(n) ________ is a function or method that is...Ch. 13 - Prob. 12MCCh. 13 - You can call this method to close a GUI program....Ch. 13 - You call this method to retrieve data from an...Ch. 13 - Prob. 15MCCh. 13 - If there are a group of these in a container, only...Ch. 13 - The ________ widget provides methods for drawing...Ch. 13 - Prob. 1TFCh. 13 - Prob. 2TFCh. 13 - The data that you retrieve from an Entry widget is...Ch. 13 - Prob. 4TFCh. 13 - Prob. 5TFCh. 13 - Prob. 1SACh. 13 - Prob. 2SACh. 13 - Prob. 3SACh. 13 - Prob. 4SACh. 13 - Prob. 5SACh. 13 - Prob. 6SACh. 13 - Prob. 7SACh. 13 - How can you use an IntVar object to determine...Ch. 13 - Prob. 9SACh. 13 - Prob. 1AWCh. 13 - Prob. 2AWCh. 13 - Prob. 3AWCh. 13 - Prob. 4AWCh. 13 - Write a statement that creates a Button widget....Ch. 13 - Write a statement that creates a Button widget...Ch. 13 - Assume the variable data_entry references an Entry...Ch. 13 - Prob. 8AWCh. 13 - Name and Address The Name and Address Problem...Ch. 13 - Latin Translator Look at the following list of...Ch. 13 - Miles Per Gallon Calculator Write a GUI program...Ch. 13 - Celsius to Fahrenheit Write a GUI program that...Ch. 13 - Property Tax A county collects property taxes on...Ch. 13 - Joes Automotive Joes Automotive performs the...Ch. 13 - Long-Distance Calls A long-distance provider...Ch. 13 - This Old House Use the Canvas widget that you...Ch. 13 - Prob. 9PECh. 13 - Hollywood Star Make your own star on the Hollywood...Ch. 13 - Prob. 11PECh. 13 - Solar System Use a Canvas widget to draw each of...
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.Similar questions
- Q2. Create Python program using Graphical User Interface (GUI) that will: 1. Create a tkinter main window with specific title name for the window. 2. Apply geometry command according to your desired dimension of the window. 3. Add background color to main window. 4. Add Canvas widget and give at least 4 options according to your choices. 5. Inside the canvas use the following STANDARD ITEMS CANVAS WIDGET (Arc, Image, Line, Oval and Polygon) to design the canvas with: a. Use Image as a background for the canvas. b. Star design (any size) – apply 5 options c. Rectangle (any size) – apply 5 options d. Oblong any size) – apply 5 options e. Triangle any size) – apply 5 options Save the file using:arrow_forwardProject 1: Upsampling an Image using Interpolation TechniquesThere are a number of techniques that can be used to upsample an image.In this assignment, you are expected to implement three Interpolation methods such as Cubic spline for three different images and compare the results. Example Code Python: orgImage = cv2.imread("dene.png")w, h, d = orgImage.shapexResized = int(w * scale);yResized = int(h * scale);....cv2.imwrite("resizedImage.png", resizedImage) Example Code Matlab:I = imread('pen.png');figure;imshow(I); [w, h, d ]= size(I)R = I(:,:,1);G = I(:,:,2);B = I(:,:,3); %for cubic spline write findcoefficients method[ax,bx,cx,dx ] = findCoefficients(R);[ay,by,cy,dy ] = findCoefficients(G);[az,bz,cz,dz ] = findCoefficients(B); ....R_new = ax(i)*i_d.^3 + bx(i)*i_d.^2 + cx(i)*i_d + dx(i);G_new = ay(i)*i_d.^3 + by(i)*i_d.^2 + cy(i)*i_d + dy(i);B_new = az(i)*i_d.^3 + bz(i)*i_d.^2 + cz(i)*i_d + dz(i);arrow_forward7.Do code complete"""You are given an n x n 2D mat representing an image. Rotate the image by 90 degrees (clockwise). Follow up:Could you do this in-place?""" # clockwise rotate# first reverse up to down, then swap the symmetry# 1 2 3 7 8 9 7 4 1# 4 5 6 => 4 5 6 => 8 5 2# 7 8 9 1 2 3 9 6 3 def rotate(mat): if not mat: return mat mat.reverse() for i in range(len(mat)): for j in range(i): mat[i][j], mat[j][i] = mat[j][i], mat[i][j] return mat if __name__ == "__main__": mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].arrow_forward
- Create a window and add a canvas to it. Now draw an arc, a polygon and an oval within this canvas. You can place them at random positions within the screen as long as they are visible and can be seen when executing the program. Example attached NOTE*** polygon is needed as well! (yellow shape). Previous expert did not include the polygon in the code. Thank you!arrow_forwardWrite a program that will use WheelsFX shapes to create a Car. Car must contain 6 parts (wheels, body, etc.) : Car must use 3 different kinds of shapes (Rectangle, Ellipse, etc.)arrow_forward1. Create a vector of time ranging from 0 to 41 seconds with an increment of 0.01 seconds between points. Suppress output to the command window. 2. Evaluate the function ℎ(??) at the points in the time vector using element-by-element math. Suppress output to the command window. 3. Create a new figure window and plot the height versus time of the rocket. Be sure to include appropriate labels and units for the x and y axes. 4. Since we are concerned with approximating the derivative of the height at the critical time of ???? = 7.5 seconds, define this time value as a scalar variable and evaluate the height at this point. DO NOT suppress output to the command window. 5. In order to approximate the derivative at the critical time, we should move forward in time some increment ∆?? away from the critical point as previously demonstrated in Figure 1. We would like to explore the effect of moving forward by different amounts. Create a vector that contains increments corresponding to 20, 15,…arrow_forward
- Computer Science 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_forwardObjectives: 1. To utilize the predefined methods found in the Graphics class under the AWT package. 2. To demonstrate creativity in designing graphics for a certain class. Activity: Write a program that shows your own happy face character using the different shapes found in the Graphics class. The program should ask for a name and asks the user to choose from a list of at least 3 colors using JOptionPane. The name will appear in the Graphics canvas on top or below the character, while the color will be applied to the character's main face. Required: There exists at least one or more of each of the following methods: - drawOval()/fillOval() - drawRect()/fillRect() - drawPolygon()/fillPolygon() - drawline() - drawArc()/fillArc() - setColor(new Color(R,G,B)) - setFont(new Font(type, style, size)) - drawstring()arrow_forwardPlease add a comment (# this is a comment) on each line or block to briefly explain what it does.arrow_forward
- (2) You will need to use the module graphics.py for this program. Write a program that con- structs a window, invites the user to present two clicks for the opposite vertices of a rectangle and then draws a red rectangle with those two opposite vertices. Finally, prompt the user to click to close the window.arrow_forwardDescription of animation In informal language, here is an example description of the animation for the "Simple Animation": Create red rectangle R with corner at (200,200), width 50and height 100 Create blue oval C with center at (500,100), radius 60 and30 R appears at time t=1 and disappears at time t=100 C appears at time t=6 and disappears at time t=100 R moves from (200,200) to (300,300) from time t=10 to t=50 C moves from (500,100) to (500,400) from time t=20 to t=70 C changes from blue to green from time t=50 to t=80 R moves from (300,300) to (200,200) from time t=70 tot=100 R changes width from 50 to 25 from time t=51 to t=70 We use a time reference for each step in the animation. This time reference is usually unitless, which helps us in describing animation without mentioning its absolute speed. Further, the animation must adhere to certain constraints. For example, one cannot have move the same rectangle to the left and right during overlapping…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
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY