Create an application that lets the user know how many Pounds he/she will have when they get to England based on the number of dollars they have now. Also do the reverse. Calculate how many Dollars they will have when they return based on the number of Pounds they have when in England. Do the same for travelers going to Europe. Convert Dollars to Euro and Euro to Dollars. Program should allow you to enter the customer name, destination, money converted from and money converted to. After each customer transaction the name, destination, and both money amounts should be stored on a history file. Because the exchange rate changes daily you want a system that will easily adapt to the change. Your program needs to read text file (notepad) that will contain the conversion rates. That way each morning when you get to work you can put the new rates in the text file. Your program will read the text file as soon as you turn it on (Form_Load) and be ready to make conversions that day. For example, you have a client couple coming to your office Friday morning. They are traveling to London that day. When you came in to work you updated the conversion rates for the day. Your client couple have $1,000 in US Dollars. Your program will convert that to 1,280 Pound Sterling (assuming the exchange rate for the day is 1.28 (this information is available with a Google search).
Create an application that lets the user know how many Pounds he/she will have when they get to England based on the number of dollars they have now. Also do the reverse. Calculate how many Dollars they will have when they return based on the number of Pounds they have when in England. Do the same for travelers going to Europe. Convert Dollars to Euro and Euro to Dollars.
Because the exchange rate changes daily you want a system that will easily adapt to the change. Your program needs to read text file (notepad) that will contain the conversion rates. That way each morning when you get to work you can put the new rates in the text file. Your program will read the text file as soon as you turn it on (Form_Load) and be ready to make conversions that day.
For example, you have a client couple coming to your office Friday morning. They are traveling to London that day. When you came in to work you updated the conversion rates for the day. Your client couple have $1,000 in US Dollars. Your program will convert that to 1,280 Pound Sterling (assuming the exchange rate for the day is 1.28 (this information is available with a Google search).

NOTE: The programming language is not mentioned. Therefore, the program is written in Python language.
The Python program for the given problem is as follows:
# Take the number of customers from the user and store it in variable n
n=int(input("Enter the number of customers: "))
# Read the file Conversion.txt and convert it into list f
f=open('Conversion_rate.txt','r').readlines()
# Create an empty list lines
lines=[]
for i in f:
i=i.replace("\n","").split("=")
lines.append(i)
# create an empty list conversion
conversion=[]
for i in range(len(lines)):
for j in range(len(lines)):
lines[i][j]=lines[i][j].strip()
conversion.append(lines[i][j])
dollar_pound=conversion[1].split()
# Store the conversion rate from dollar to pound in variable rate1
rate1=eval(dollar_pound[0])
pound_dollar=conversion[3].split()
# Store the conversion rate from pound to dollar in variable rate2
rate2=eval(pound_dollar[0])
# Open the file history.txt in write mode
file=open("history.txt","w")
# Store the details of the n customers in file
for i in range(1,n+1):
name=input("Enter the name of the customer: ")
destination=input("Enter the destination: ")
original_currency=input("Enter the original currency: ")
converted_currency=input("Enter the converted currency: ")
amount=int(input("Enter the amount of money to be converted: "))
if original_currency=="Dollar":
converted_amount=amount*rate1
else:
converted_amount=amount*rate2
# Write the values in file
file.write("Customer "+str(i)+"\n")
file.write("Name: "+name+"\n")
file.write("Destination: "+destination+"\n")
file.write("The original amount : "+str(amount)+" "+original_currency+"\n")
file.write("The converted money: "+str(converted_amount)+" "+converted_currency+"\n")
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images









