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 »
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.
Answered 1 days AfterMar 29, 2021

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

Shashi Kant answered on Mar 30 2021
135 Votes
Currency/currency.py
# first install (pip install forex-python)
# install this on terminal
# you have to write exact
same command to install
# pip install forex-python
#importing CurrencyRates from forex_python.converter
from forex_python.converter import CurrencyRates
# Takin input from the user to conver in diffrent currency rates
Dollars = float(input("Enter the number of U.S. dollars: "))
# creating an object Currency of the class CurrencyRates
Currency = CurrencyRates()
# Converting USD to INR by method convert by object Currency and passing parameter.
# Parameter is the input which user gave to convert
USDtoINR = Currency.convert('USD', 'INR', Dollars)
print("USD to INR is : ", USDtoINR)
# Converting USD to EUR by method convert by object Currency and passing parameter.
USDtoEUR = Currency.convert('USD', 'EUR', Dollars)
print("USD to EUR is : ", USDtoEUR)
# Converting USD to CAD by method convert by object Currency and passing parameter.
USDtoCAD = Currency.convert('USD', 'CAD', Dollars)
print("USD to CAD is : ", USDtoCAD)
# Converting USD to JPY by method convert by object Currency and passing parameter.
USDtoJPY = Currency.convert('USD', 'JPY',...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here