Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.title("Escape from the Maze")
root.geometry("600x300")
frame = ttk.Frame(root, padding="200 100 200 100")
frame.pack(fill=tk.BOTH, expand=True)
def click_button1():
root.title("Wrong way!")
def click_button2():
root.destroy()
button1 = ttk.Button(frame, text="Go Left", command=click_button1)
button2 = ttk.Button(frame, text="Go Right", command=click_button2)
button1.pack()
button2.pack()
root.mainloop()
from tkinter import ttk
root = tk.Tk()
root.title("Escape from the Maze")
root.geometry("600x300")
frame = ttk.Frame(root, padding="200 100 200 100")
frame.pack(fill=tk.BOTH, expand=True)
def click_button1():
root.title("Wrong way!")
def click_button2():
root.destroy()
button1 = ttk.Button(frame, text="Go Left", command=click_button1)
button2 = ttk.Button(frame, text="Go Right", command=click_button2)
button1.pack()
button2.pack()
root.mainloop()
Refer to Code Example 18-1: Which code snippet adds the frame to the root window?
a. |
root.mainloop()
|
|
b. |
root = tk.Tk()
root.title("Escape from the Maze") root.geometry("600x300") |
|
c. |
frame = ttk.Frame(root, padding="200 100 200 100")
frame.pack(fill=tk.BOTH, expand=True) |
|
d. |
import tkinter as tk
from tkinter import ttk |
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
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
- Update it to create a class Student that includes four properties: an id (type Integer), a name (type String), a Major (type String) and a Grade (type Double). Use class Student to create objects (using buttonAdd) that will be read from the TextFields then save it into an ArrayList. Perform the following queries on the ArrayList of Student objects and show the results on the listViewStudents (Hint: add buttons as needed): d) Use lambdas and streams to calculate the total average of all Students grades, then show the result. 1. Ch3HW; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class MainApp extends Application{ @Override publicvoidstart(StageprimaryStage) throwsException { FXMLLoader loader =newFXMLLoader(getClass().getResource("StudentScreen.fxml")); Parent parent = loader.load(); Scene scene =newScene(parent);…arrow_forwardI need help creating this page in Java using Java GUI. It's a map of 30 hexagons. The map should have 30 buttons respectively for each of the hexagons, with the numbers as it's name (Ex: button = new JButton ("2")).arrow_forwardExecute the following statements over initially empty ArrayList myList one after another (cascade). Explain what was changed after each statement (what did it do?) myList.add("z"); ArrayList content: Your explanation (where this output came from): myList.add(0, "a"); ArrayList content: Your explanation (where this output came from): myList.add("t"); ArrayList content: Your explanation (where this output came from): myList.add(2,"w"); ArrayList content: Your explanation (where this output came from): myList.set(0,"b"); ArrayList content: Your explanation (where this output came from):arrow_forward
- import bridges.base.ColorGrid;import bridges.base.Color;public class Scene {/* Creates a Scene with a maximum capacity of Marks andwith a background color.maxMarks: the maximum capacity of MarksbackgroundColor: the background color of this Scene*/public Scene(int maxMarks, Color backgroundColor) {}// returns true if the Scene has no room for additional Marksprivate boolean isFull() {return false;}/* Adds a Mark to this Scene. When drawn, the Markwill appear on top of the background and previously added Marksm: the Mark to add*/public void addMark(Mark m) {if (isFull()) throw new IllegalStateException("No room to add more Marks");}/*Helper method: deletes the Mark at an index.If no Marks have been previously deleted, the methoddeletes the ith Mark that was added (0 based).i: the index*/protected void deleteMark(int i) {}/*Deletes all Marks from this Scene thathave a given Colorc: the Color*/public void deleteMarksByColor(Color c) {}/* draws the Marks in this Scene over a background…arrow_forwardCreate an Empty Activity Project to implement the following Layouts. Layouts: one Text, one E-mail, one Image and one Button. Tips: - The project’s layout structure is ConstraintLayout. - The first element is Text. You must write your name in place of “XYZ” with a textSize = 20sp and textColor of Red. - The second element is E-mail. You must write your email address under your name, with the textColor = Blue. - The third element is an image. You can add any image after your name and email with any size you like. - The fourth element is a button. Place the button on the end of the page and call it ”OK”. Implement the previous requirements and include the XML file and screenshot of the layout’s output, after you run the application. Layout’s output:arrow_forwardPlease see the snip for the detail. Note: The polygon have to rotate clockwise in same also counterclock wise have to rotate: here is my code it have issue it only rotate to clockwise but in same time have to rotate to the counterclockwise too but it not plesase fix it or write from new. my code: import turtle as t import math class CenteredPolygon: def __init__(self, n, size, center=(0, 0), pen=None, **kwargs): self.numsides = n self.size = size self.center = center self.corners = [] self.pen = pen if pen is not None else self.init_pen(**kwargs) self.draw() def init_pen(self, **kwargs): pen = t.Turtle() for key, value in kwargs.items(): try: f = getattr(pen, key) f(value) except Exception as e: print(e) return pen def set_corners(self) -> list: p = self.pen p.pu() p.goto(self.center) for i…arrow_forward
- import pandas as pd import statsmodels.formula.api as sm import matplotlib.pyplot as plt X1 = np.random.normal (0, 1, 100) X2 = X1 + 3 Y = X1 + X2 + np.random.normal(0, 1, 100) df = pd.DataFrame ({"Y": Y, "X1": X1, "X2": X2}) linmodel = sm.ols(formula "Y X1 + X2", data df).fit() linmodel.summary() Output: Intercept -0.0272 X1 1.1074 X2 1.0257 Warnings: [1] Standard Errors assume that the covariance matrix of the errors is correctly specified. [2] The smallest eigenvalue is 3.27e-31. This might indicate that there are strong multicollinearity problems or that the design matrix is singular. Which of the following statements are correct? a) Perfectly correlated regressors X1 and x2 are used. b) Either X1 or X2 should be excluded, as the second regressor does not add any information to the model. 6. c) The second warning indicates that the model fit to the data is perfect.arrow_forwardquestion in the image: let timerId = null; window.addEventListener("DOMContentLoaded", function() { document.addEventListener("click", startAnimation);}); function startAnimation(e) { // Get mouse coordinates let clickX = e.clientX; let clickY = e.clientY; // TODO: Modify the code below moveImage(clickX, clickY); } function moveImage(x, y) { const img = document.querySelector("img"); // Determine location of image let imgX = parseInt(img.style.left); let imgY = parseInt(img.style.top); // Determine (x,y) coordinates that center the image // around the clicked (x, y) coords const centerX = Math.round(x - (img.width / 2)); const centerY = Math.round(y - (img.height / 2)); // TODO: Add code here // Move 1 pixel in both directions toward the click if (imgX < centerX) { imgX++; } else if (imgX > centerX) { imgX--; } if (imgY < centerY) { imgY++; } else if (imgY > centerY) { imgY--;…arrow_forwardI don't need the get_new_item and the color of the items but it breaks the code, how do I fix this? WEIGHT_LIMIT = 100COUNT_LIMIT = 4wizard_inventory = [] def display_title(): print("The Wizard Inventory program") print() def display_menu(): print("COMMAND MENU") print("show - Show all items") print("grab - Grab an item") print("edit - Edit an item") print("drop - Drop an item") print("exit - Exit program") print() def show(inventory): print("Show inventory") for i in inventory: print(i[0], i[1], "(", i[2], ")lbs") total = calculate_weight(inventory) print("Total Weights is : ", total, "lbs") print(" Weight limits of 100 lbs") def calculate_weight(inventory): total = 0 for i in inventory: print(i[2]) total = total + float(i[2]) return totaldef grab_item(inventory): list = [] total = 0 if (len(inventory) < 4): list.extend(get_new_item()) print(list) total =…arrow_forward
- Minecraft is an open-world video game based on placing and interacting with 3D textured blocks. If you are not familiar with the game, each player has a personal inventory which can hold a limited number of blocks and items. Specific blocks and items can be combined on a crafting table to form new items. For example, three wheats arranged in a horizontal line on a crafting table gives the player one loaf of bread. These combinations are known as crafting recipes and the game has hundreds of them. This question deals with the recipe for making a cake. One cake requires 1 egg. 2 sugars, 3 wheats and 3 buckets of milk. Your job is to build a program to help the player determine how many cakes they can make based on the number of ingredients that they have. Crafting Figure 2: A screenshot from Minecraft showing a crafting table showing the recipe for making a cake. Your program won't make this picture, this is just showing you the rules for making a cake! Most items in the player's…arrow_forwardNeed guidance on how to use Tkiner in visual studio. The tkiner program doesn't run, it shows as a syntax error. Code: from tkinter import* import tkinter.messagebox class Library: def __init_(self,root): self.root = root self.root.title("Library Inventory System") self.root.geometry("1350x750+0+0") BookId = StringVar() AuthorFullName=StringVar() PublicationYear=StringVar() BookTitle=StringVar() num_copies=StringVar() #===================Frames==========================# MainFrame = Frame(self.root) MainFrame.grid() TitleFrame = Frame(MainFrame, bd=2, padx=40, pady=8, bg="Cadet blue", relief=RIDGE) TitleFrame.pack(side=TOP) self.libTitle =Label(TitleFrame, font=('arial',46,'bold'),text="Library Inventory System") self.libTitle.grid(sticky=W) ButtonFrame…arrow_forwardWrite a code to the following image using Console.WriteLine.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