Create a program that converts U.S. dollars to different currencies -- the Canadian dollar, Euro, Indian rupee, Japanese yen, Mexican peso, South African rand, and British pound. The application's...

1 answer below »
Pease see attached


Create a program that converts U.S. dollars to different currencies -- the Canadian dollar, Euro, Indian rupee, Japanese yen, Mexican peso, South African rand, and British pound. The application's interface should prompt the user to enter the number of U.S. dollars, and then display the seven currencies listed above.  Display the result to three decimal places. This should be done in a very basic manner as this is the third assignment in a computer programming I class so this shouldn’t be sophisticated at all. A GUI would work best as an interface. Once complete the program should be copied in a word doc only with screen shots of the program working. I have attached an example. Create a program that converts U.S. dollars to different currencies -- the Canadian dollar, Euro, Indian rupee, Japanese yen, Mexican peso, South African rand, and British pound. The application's interface should prompt the user to enter the number of U .S. dollars, and then display the seven currencies listed above. Display the result to three decimal places. This should be done in a very basic manner a s th is is the third assignment in a compu ter programming I class so this shouldn’t be sophisticated at all . A GUI would work best as an interface . O nce complete the program should be copied in a word doc only with screen shots of the program working . I have attached an example . Create a program that converts U.S. dollars to different currencies -- the Canadian dollar, Euro, Indian rupee, Japanese yen, Mexican peso, South African rand, and British pound. The application's interface should prompt the user to enter the number of U.S. dollars, and then display the seven currencies listed above. Display the result to three decimal places. This should be done in a very basic manner as this is the third assignment in a computer programming I class so this shouldn’t be sophisticated at all. A GUI would work best as an interface. Once complete the program should be copied in a word doc only with screen shots of the program working. I have attached an example. Gabriel Matos University of the Incarnate Word Professor Robert Whale Computer Programming I 3/20/21 Program: from tkinter import * from tkinter import messagebox def interface(): def clicked(): try: n = int(number_of_people.get()) no_of_vans = int(n/10) number_of_vans_label = Label(screen, text = 'Number of vans: '+str(no_of_vans)) number_of_vans_label.grid(column = 0, row = 3) number_of_people_remaning = n%10 number_of_people_remaning_label = Label(screen, text = 'Number of people remaining: '+str(number_of_people_remaning)) number_of_people_remaning_label.grid(column = 0, row =4) except: messagebox.showerror('Vans & More Depot','Enter int value for passengers') screen = Tk() screen.title("Vans & More Depot") screen.geometry('350x200') number_of_people_label = Label(screen, text = 'Enter the number of people: ') number_of_people_label.grid(column = 0, row = 1) number_of_people = Entry(screen, width = 20) number_of_people.grid(column = 1, row = 1) button = Button(screen, text="Calculate", command=clicked) button.grid(column=1, row=2) screen.mainloop() interface() Screenshots of the Program running with the GUI: Gabriel Matos U niversity of the Incarnate Word Professor Robert Wha le Computer Programming I 3/20/21 Program : from tkinter import * from tkinter import messagebox def interface(): def clicked(): try : n = int (number_of_people.get()) no_of_vans = int (n/10) number_of_vans_label = Label (screen, text = 'Number of vans: ' + str (no_of_vans)) number_of_vans_label.grid(column = 0, row = 3) number_of_people_remaning = n%10 number_of_people_remaning_label = Label (screen, text = 'Number of people remaining: ' + str (number_of_people_remaning)) number_of_ people_remaning_label.grid(column = 0, row =4) except : messagebox .showerror( 'Vans & More Depot' , 'Enter int value for passengers' ) screen = Tk () screen.title( "Vans & More Depot" ) screen.geometry( '350x200' ) number_of_peop le_label = Label (screen, text = 'Enter the number of people: ' ) number_of_people_label.grid(column = 0, row = 1) number_of_people = Entry (screen, width = 20) number_of_people.grid(column = 1, row = 1) button = Button (screen, text= "Calculate" , command=clicked) button.grid(column=1, row=2) screen.mainloop() interface() Gabriel Matos University of the Incarnate Word Professor Robert Whale Computer Programming I 3/20/21 Program: from tkinter import * from tkinter import messagebox def interface(): def clicked(): try: n = int(number_of_people.get()) no_of_vans = int(n/10) number_of_vans_label = Label(screen, text = 'Number of vans: '+str(no_of_vans)) number_of_vans_label.grid(column = 0, row = 3) number_of_people_remaning = n%10 number_of_people_remaning_label = Label(screen, text = 'Number of people remaining: '+str(number_of_people_remaning)) number_of_people_remaning_label.grid(column = 0, row =4) except: messagebox.showerror('Vans & More Depot','Enter int value for passengers') screen = Tk() screen.title("Vans & More Depot") screen.geometry('350x200') number_of_people_label = Label(screen, text = 'Enter the number of people: ') number_of_people_label.grid(column = 0, row = 1) number_of_people = Entry(screen, width = 20) number_of_people.grid(column = 1, row = 1) button = Button(screen, text="Calculate", command=clicked) button.grid(column=1, row=2) screen.mainloop() interface()
Answered 2 days AfterMar 31, 2021

Answer To: Create a program that converts U.S. dollars to different currencies -- the Canadian dollar, Euro,...

Shashi Kant answered on Apr 02 2021
154 Votes
currency/Currency.py
# First install (pip install forex-python)
# Install this on your terminal
# Write the exact command to install
# pip install forex-python
#importing CurrencyRates from forex_python.converter
from forex_python
.converter import CurrencyRates
# importing functions from the tkinter
# Here * means all the functions will be import
from tkinter import *
import requests
# Create a GUI window
window = Tk()
# Title for the GUI
window.title("Currency Conversion")
# create a global variables
to = StringVar(window)
to_from = StringVar(window)
# initialise the variables
to.set("Currency")
to_from.set("Currency")
# Function to perform CurrencyConversion
# from one currency to another currency
def CurrencyConversion():
    # importing required libraries
    Currency = CurrencyRates()
    # getting the currency code which was selected
    # by the user
    from_currency = to.get()
    to_currency = to_from.get()
    # geting the amount which is entered by the user.
    amount = float(Amount1_field.get())
    # calculating with the amount for Currency Conversion
    new_amount = Currency.convert(from_currency, to_currency, amount)
    # insert method inserting the value in the text entry box.
    Amount2_field.insert(0, str(new_amount))
# Function for clearing the Entry field
def clear_all() :
    # delete method will clear the textboxes from GUI
    Amount1_field.delete(0, END)
    Amount2_field.delete(0, END)
    
if __name__ == "__main__" :
    # Set the configuration of GUI window (WidthxHeight)
    window.geometry("400x250")
    # Creating welcome to Real Time Currency Convertor label
    headlabel = Label(window, text = 'Welcome To Currency Convertor',fg = 'black')
    # Creating a "Amount :" label
    label1 = Label(window, text = "Amount :", fg = 'black')
    
    # Creating a "From Currency :" label
    label2 = Label(window, text = "From Currency", fg = 'black')
    # Creating a "To Currency: " label
    label3 = Label(window, text = "To Currency :", fg = 'black')
    # Creating a "Converted Amount :" label
    label4 = Label(window, text = "Converted Amount :", fg = 'black')
    # grid method is used for placing the widgets at respective positions
    # in table like structure .
    headlabel.grid(row = 0, column = 1)
    label1.grid(row = 1, column = 0)
    label2.grid(row = 2, column = 0)
    label3.grid(row = 3, column =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here