Python for Software Development
Institution
Professor
Student
Date
Python for Software Development
QUESTION 1
This code generates a simple graphical user interface window with two access areas for the quantity and
coins to omit. Whenever the user selects the "Calculate" button, the application computes the smallest
coin shift for the provided amount while omitting the chosen coins and presents the outcome in a
caption. You may update the code to add more GUI components or modify the structure to suit your
needs.
scss
tkinter should be imported as tk
# Create a graphical user interface panel
tk.Tk = root ()
root.title("Minimum-Coin Change Assessment") ("Minimum-Coin Change Evaluation")
# Create a program to compute the smallest coin change.
# Create a program to compute the smallest coin change. e change() is defined as follows:
# Get client input
int(amount entry.get()) = quantity
[int(exclude entry.get())] exclusion
coins = [1, 2, 5, 10, 20, 50, 100, 200]
search for coin in:
coins.remove(coin)
# Determine the smallest coin exchange
[] coin counts
amount = coin count / coin
coin * coin count = amount
coin counts.append(coin count)
coin counts.reverse()
# Show the smallest coin difference
config(text="Minimum coin change: " + ", ".join([f"coin counts[i]xcoins[i]p" for I in range(len(coins)) if
coin counts[i] > 0])
# Design GUI components
tk.Label(root, text="Amount:") = amount label
tk.Entry = amount entry (root)
tk.Label(root, text="Exclude coins:") = exclude label
tk.Entry exclude entry = tk.Entry (root)
tk.Button(root, text="Calculate", command=calculate change)
tk.Label change label = tk.Label (root)
# Add GUI components to the window.
grid(row=0, column=0) amount label
grid(row=0, column=1) for amount entry
grid(row=1, column=0) exclude label
grid(row=1, column=1) exclude entry
grid(row=2, column=0, columnspan=2) calculate button
grid.change label(row=3, column=0, columnspan=2)
# Open the graphical user interface window
root.mainloop()
QUESTION 2
A 30-minute viva would be held as part of the assessment, during which the student would give a
demonstrate of the system that was developed. The student may present using 1 to 4 PowerPoint
slides, but a live demonstration of the system is required.