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 7PE
Program Plan Intro

Rolling the dice

Program Plan:

CButton.py:

  • Import the required packages.
  • Definition of “__init__” method.
    • Get the x and y position
    • Set the center and radius value.
    • Create a circle and radius.
    • Call the method “draw()”.
    • Assign the label.
    • Call the method “draw()”.\
  • Add the method “getLabel()”, “activate()”, “deactivate()” from the “button.py” module.
  • Define the “clicked()” method.
    • Return “true” if button is active and “p” is inside.

roller.py:

  • Import the required packages.
  • Definition of main.
    • Create the application window.
    • Draw the interface widgets.
    • Create button “Roll Dice”.
    • Activate the button.
    • Create button “Quit”.
    • Call the method “getMouse()”.
    • Check the condition if the button is clicked.
      • Roll the die.
      • Call the activate method for quit button.
      • Call the “getMouse()”.
    • Close the window.
  • Call the main function.

Blurred answer
Students have asked these similar questions
2:21 m Ο 21% AlmaNet WE ARE HIRING Experienced Freshers Salesforce Platform Developer APPLY NOW SEND YOUR CV: Email: hr.almanet@gmail.com Contact: +91 6264643660 Visit: www.almanet.in Locations: India, USA, UK, Vietnam (Remote & Hybrid Options Available)
Provide a detailed explanation of the architecture on the diagram
hello please explain the architecture in the diagram below. thanks you
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
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:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning