Formulas: Simple Interest-DPrincipal rate time in years/100 Amount Simple Interest + Principal Use TKinter to bullda GUlapplication that calculates the simple interest for customers. The GUI must take Principal, Rate of interest, and Time in years as inputs from thne user, and calculate the Simple Interestas well as the Total Amountin your program at thecick of a button. It must then display these 2 values on the GUlwindow. Points will be given based on how userfriendly your GUIS. Somake sue younLapels, button, eta have appropriate text with units if necessary.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Please comment for me to understand.
Formulas:
Simple Interest-Principalrate* tmein years/100
Amount Simple Interest +Principal
Use TKinter to bulda GUlapplication that calculates the simple interest forcusromers.
The GUI must take Principal, Rate ofinterest, and Time in years as nputs from the use, and calculate
the Simple Interestas well as the Total Amountin your program at thecick of a button. It must then
display these 2 values on the Gulwindow.
Points will be given basedon how userfnendlyyourGUis. Samakesure younLagels, button, eta have
appropriate text with units f necessary.
Transcribed Image Text:Formulas: Simple Interest-Principalrate* tmein years/100 Amount Simple Interest +Principal Use TKinter to bulda GUlapplication that calculates the simple interest forcusromers. The GUI must take Principal, Rate ofinterest, and Time in years as nputs from the use, and calculate the Simple Interestas well as the Total Amountin your program at thecick of a button. It must then display these 2 values on the Gulwindow. Points will be given basedon how userfnendlyyourGUis. Samakesure younLagels, button, eta have appropriate text with units f necessary.
Expert Solution
Step 1
from tkinter import *

def clear():
#set all the entry boxes to empty
principle.delete(0, END)
rate.delete(0, END)
time.delete(0, END)
interest.delete(0, END)
amount.delete(0, END)

def calculate_interest():
#get values from entry boxes
p = float(principle.get())
r = float(rate.get())
t = float(time.get())
#calculate simple interest
si = (p*r*t)/100
#insert it to entry box
interest.insert(10, si)
#calculate amount
a = si+p
#insert it to entry box
amount.insert(10, a)

if __name__ == "__main__":
#create window
root = Tk()
#set background color of GUI
root.configure(background='sky blue')
#set size of GUI window
root.geometry("400x300")
#set title of window
root.title("Simple Interest Calculator")
#create five required labels
label1 = Label(root, text="Principle Amount(Rs)", fg='black', bg='white')
label2 = Label(root, text="Rate(%)", fg='black', bg='white')
label3 = Label(root, text="Time(years)", fg='black', bg='white')
label4 = Label(root, text="Simple Interest(Rs)", fg='black', bg='white')
label5 = Label(root, text="Amount(Rs)", fg='black', bg='white')
label1.grid(row=1, column=0, padx=10, pady=10)
label2.grid(row=2, column=0, padx=10, pady=10)
label3.grid(row=3, column=0, padx=10, pady=10)
label4.grid(row=5, column=0, padx=10, pady=10)
label5.grid(row=6, column=0, padx=10, pady=10)
# create five entry boxes
principle = Entry(root)
rate = Entry(root)
time = Entry(root)
interest = Entry(root)
amount = Entry(root)
principle.grid(row=1, column=1, padx=10, pady=10)
rate.grid(row=2, column=1, padx=10, pady=10)
time.grid(row=3, column=1, padx=10, pady=10)
interest.grid(row=5, column=1, padx=10, pady=10)
amount.grid(row=6, column=1, padx=10, pady=10)
#button to calculate simple interest and amount
button1 = Button(root, text="Submit", bg="black", fg="white", command=calculate_interest)
#button to clear all the data in entry boxes
button2 = Button(root, text="Clear", bg="black", fg="white", command=clear)
button1.grid(row=4, column=1, pady=10)
button2.grid(row=7, column=1, pady=10)
#start the GUI
root.mainloop()
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY