Question

In: Computer Science

Design a GUI application for the Bank Account assignment you did in the File IO module....

Design a GUI application for the Bank Account assignment you did in the File IO module.

It can be simple as a single user app with three buttons - checkBalance, Withdraw, Deposit - textbox for entering the amount.

On Click of buttons, you can show the current balance in a dialog box.

If you have more interest, you can expand it further according to your design of the application

In python

Please show codes and output.

The calculator must be in a standard size not too small not to big

Solutions

Expert Solution

Answer :

Code:-

import tkinter as tk
class Application(tk.Frame):
def _init_(self, master=None):
super()._init_(master)
self.master = master
self.pack()
self.create_widgets()
self.amount = 0
def deposit(self):
i = (int)(self.en.get())
if(i>0):
self.amount += i
self.en.delete(0, 'end')
self.lab.config(text="Succeessfully deposited {}".format(i))
else:
self.en.delete(0, 'end')
self.lab.config(text="Error occured try again")
def show(self):
print(self.amount)
self.lab.config(text="you have {}".format(self.amount))
def withdraw(self):
i = (int)(self.en.get())
self.en.delete(0, 'end')
if(i<self.amount):
self.amount -= i
self.lab.config(text="Succeessfully withdrawed {}".format(self.amount))
else:
self.lab.config(text="You dont have sufficient amount")
def create_widgets(self):
self.head = tk.Label(self,text="Welcome to Bank",font=("Courier", 25))
self.head.grid(row=0,column=1)
self.a = tk.Button(self, text ="Show" , width=10, height=2, command=self.show)
self.b = tk.Button(self, text="Deposit", width=10, height=2, command=self.deposit)
self.c = tk.Button(self, text="Withdraw", width=10, height=2, command=self.withdraw)
self.a.grid(row=1,column=0)
self.c.grid(row=1,column=1)
self.b.grid(row=1,column=2)
self.enlab = tk.Label(self,text="Enter amount:",font=("Courier", 20));
self.enlab.grid(row=2,column=0)
self.en = tk.Entry(self)
self.en.grid(row=2,column=1)
self.lab = tk.Label(self,font=("Courier", 20));
self.lab.grid(row=3,column=1)
root = tk.Tk()
app = Application(master=root)
app.master.title("Bank Application")
app.master.maxsize(800, 400)
app.master.minsize(800, 400)
app.grid_rowconfigure(4,minsize=20)
app.mainloop()

Code Screenshots :-

Output :-

I hope this answer is helpful to you, If you like Please Upvote(Thums up) my answer.I'm need of it,

Thank you.


Related Solutions

You will design and create your own GUI application for the Bank project. This project should...
You will design and create your own GUI application for the Bank project. This project should be designed and written by Java programming. The requirements of the program: 1. The program will be best implemented as a multi-file program for each class. 2. The parameters and return types of each function and class member should be decided in advance. You may need to add more member variables and functions to the classes than those listed below. Also, you can throws...
Download this file to your hard drive and follow the instructions in the Module 9 Assignment...
Download this file to your hard drive and follow the instructions in the Module 9 Assignment (Word) document. Prepare two files for your post. The first file should be a text file containing your Python solution. The second file should contain your output file(txt). Complete the following using Python on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples:...
Object Design Example: Bank Account Object Implement the bank account class that stores account number and...
Object Design Example: Bank Account Object Implement the bank account class that stores account number and the balance. It has methods to deposit and withdraw money. In addition, the default constructor sets account number to 0000 and balance 0. Other constructor should take the account number and the initial balance as parameters. Finally, the account class should have a static data member that stores how many accounts are created for a given application. a) Draw the UML diagram b) Write...
What factors should you consider when choosing between a console application and a GUI application?
What factors should you consider when choosing between a console application and a GUI application?
Create a Software Application for XYZ Bank that allows its members to access their bank account...
Create a Software Application for XYZ Bank that allows its members to access their bank account information through an “ATM like” interface. The Menu Options should include: checking the account balance, debiting the account and crediting the account, along with an option to exit the program. Create an Account Class to represent the customers’ bank accounts. Include a data member of type float to represent the account balance. Provide a constructor that receives an initial balance and uses it to...
1.   Design a class, Account, that models the basic workings of a bank account. The class...
1.   Design a class, Account, that models the basic workings of a bank account. The class should perform the following tasks: a.   Save the account balance. b.   Save the number of transactions performed on the account. c.   Allow deposits to be made to the account. d.   Allow withdrawals to be taken from the account. e.   Calculate interest for the period. f.   Report the current account balance at any time. g.   Report the current number of transactions at any time The...
Design a kernel module that creates a /proc file named /proc/jiffies that reports the current value...
Design a kernel module that creates a /proc file named /proc/jiffies that reports the current value of jiffies when the /proc/jiffies file is read, such as with the command cat /proc/jiffies Be sure to remove /proc/jiffies when the module is removed. Please help with this assignment using C programming and testing in Linux Ubuntu.
You are required to design a VoIP application. Discuss the requirements for such an application in...
You are required to design a VoIP application. Discuss the requirements for such an application in terms of its protocols and performance requirements. What types of protocols you would need to design a complete VoIP application (Hint: real time streaming protocols and signaling protocols, etc.)? [5 Marks] 2. Discuss the architecture of messanging app in terms of its protocols. Address and discuss all the essential protocols used by messaging app for communication.
15.1 File IO Warm-up For this exercise, you will receive two string inputs, which are the...
15.1 File IO Warm-up For this exercise, you will receive two string inputs, which are the names of the text files. You need to check if the input file exists. If input file doesn't exist, print out "Input file does not exist." You are required to create 4 functions: void removeSpace (ifstream &inStream, ofstream &outStream): removes white space from a text file and write to a new file. If write is successful, print out "Text with no white space is...
Assignment Requirements Write a python application that consists of two .py files. One file is a...
Assignment Requirements Write a python application that consists of two .py files. One file is a module that contains functions used by the main program. NOTE: Please name your module file: asgn4_module.py The first function that is defined in the module is named is_field_blank and it receives a string and checks to see whether or not it is blank. If so, it returns True, if not it return false. The second function that is defined in the module is named...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT