Develop GUI for an application based on user requirements. The GUI maintains a list of numbers, which is initially set t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Develop GUI for an application based on user requirements. The GUI maintains a list of numbers, which is initially set t

Post by answerhappygod »

Develop GUI for an application based on user requirements. The
GUI maintains a list of numbers, which is initially set to empty.
The initial GUI is shown in Figure Q4(a). When the user clicks on
the button Get Statistics, the GUI displays the current content of
the list on a scrollable pane.
 Figure Q4(b) shows the GUI when the list is empty; the GUI
displays a message: No statistics to produce.
 Figure Q4(e) shows the GUI when the list is non-empty; the GUI
displays minimum (that is, the smallest number), the maximum (that
is, the largest number), the total of the numbers, the count of
numbers, and the average.
When the user clicks on the button Add A Number, the GUI adds
the parameter number into the list, and clear the text field. Refer
to Figure Q4(c) and Figure Q4(d). You need not handle
exceptions.
Develop Gui For An Application Based On User Requirements The Gui Maintains A List Of Numbers Which Is Initially Set T 1
Develop Gui For An Application Based On User Requirements The Gui Maintains A List Of Numbers Which Is Initially Set T 1 (72.54 KiB) Viewed 13 times
(a) List and describe the purpose of the widgets, supporting
variables and geometry managers in the given code to implement the
GUI.
(b) Implement callback functions to allow the GUI to respond to
events in accordance to the question specifications. Use the insert
method on the ScrolledText object to write into it. For example, if
the ScrolledText object is s, the statement writes the message
Hello on s: s.insert('end', 'Hello\n')
(c) Write Python statements to bind the relevant widgets
identified in Q4(a) to the callback functions in Q4(b)
Develop Gui For An Application Based On User Requirements The Gui Maintains A List Of Numbers Which Is Initially Set T 2
Develop Gui For An Application Based On User Requirements The Gui Maintains A List Of Numbers Which Is Initially Set T 2 (42.06 KiB) Viewed 13 times
in python thanks.
You are given the partial code for the GUI. import tkinter as tk. from tkinter import ttk from tkinter.scrolledtext import Scrolled Text class StatsGui: definit_(self): self._numbers = [] self.win = tk. Tk() self.win.resizable(False, False) self.win.title("Statistics") self.create_widgets() self.win.mainloop() def create_widgets(self): dataFrame ttk. Frame(self.win) dataFrame.grid (column=0, row=0) inputDataFrame = ttk. Frame (dataFrame) p1_1b1 = ttk. Label (inputDataFrame, text="Number: ") pl_lbl.pack(side-tk. LEFT) self.numValue = tk.StringVar() self.numValue_Ety = ttk. Entry (inputDataFrame, width=18, \ textvariable-self.numValue) self.numValue_Ety.pack (side=tk. LEFT) inputDataFrame.grid (column = 0, row = 0) actionFrame = ttk. Frame(dataFrame) actionFrame.grid (column=0, row=1) self.add_btn = ttk. Button(actionFrame, text="Add A Number") self.add_btn.pack(side = tk. LEFT) self.statistics_btn = ttk.Button(actionFrame, text="Get Statistics") self.statistics_btn.pack(side = tk. LEFT) outputFrame ttk. Frame(self.win) outputFrame.grid (column=0, row=2, columnspan=2) self.output = Scrolled Text (output Frame, width=-40, height=10, \ wrap=tk.WORD) self.output.grid(column=0, row=0, sticky= 'WE', columnspan=2)
Statistics Number: Add A Number Get Statistics Statistics Figure Q4(a) Number: 12 Add A Number Get Statistics Numbers in list: [] No statistics to produce Statistics Figure Q4(c) Number: Add A Number Get Statistics Added 15 to list Numbers in list: [12, 10, 15] Minimum: 10 Maximum: 15 Total: 37 Count of numbers: 3 Average: 12.33 Figure Q4(e) X X ✓ Statistics Number: Add A Number Get Statistics Numbers in list: [] No statistics to produce ✓ Statistics Number: Add A Number Get Statistics Numbers in list: [1 No statistics to produce Added 12 to list Figure Q4(b) Figure Q4(d) X
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply