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).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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).

Expert Solution
Step 1

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

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education