Learning Objectives • use if/else statements to correctly match the provided target to what's stored in the program • store the input values and hard-coded values to use them in computations • potentially, store hard-coded values in a data structure that makes retrieving them easier; see the more advanced lab later. Instructions Our program will work to help people to exchange USD to the following other currencies: USD EUR CNY JPY. You can hard-code the following exchange rates for them: USD to EUR = 0.86 USD to CNY = 6.44 USD to JPY = 114.38 USD to CAD = 1.24 Note that you can hard-code these values as part of the computation or store them in a data structure that will allow you to easily retrieve them. 1. The user inputs the name of the target currency as target_currency. 2. The user inputs the amount of money they want to convert as money_amount. 3. Print the result of conversion to the user in the following format. You can compare the target_currency and all of the currencies above one by one using if statements. If the input matches the currency, the program should calculate the result and print the output. From 10 USD we will have 8.60 EUR

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

Not sure how to do this problem.

main.py
Load default template.
1 target_currency = input()
2 money_amount = int(input())
3
4" Your code is here ""
Transcribed Image Text:main.py Load default template. 1 target_currency = input() 2 money_amount = int(input()) 3 4" Your code is here ""
Learning Objectives
• use if/else statements to correctly match the provided target to what's stored in the program
• store the input values and hard-coded values to use them in computations
• potentially, store hard-coded values in a data structure that makes retrieving them easier; see the more
advanced lab later.
Instructions
Our program will work to help people to exchange USD to the following other currencies: USD EUR CNY JPY.
You can hard-code the following exchange rates for them:
USD to EUR = 0.86
USD to CNY = 6.44
USD to JPY = 114.38
USD to CAD = 1.24
Note that you can hard-code these values as part of the computation or store them in a data structure that will
allow you to easily retrieve them.
1. The user inputs the name of the target currency as target_currency.
2. The user inputs the amount of money they want to convert as money_amount.
3. Print the result of conversion to the user in the following format. You can compare the target_currency
and all of the currencies above one by one using if statements. If the input matches the currency, the
program should calculate the result and print the output.
From 10 USD we will have 8.60 EUR
where 10 is the input money_amount (step 2 above), and 8.60 is the the calculated result for the input
target_currency (EUR).
Note - all results must be always reported with 2 digits after the decimal point (i.e. the period in the number).
If there is no such currency, then print
Sorry, we are unable to convert USD to Y
Where Y is the provided target currency.
Example Input
EUR
10
Example Output
From 10 USD we will have 8.60 EUR
Transcribed Image Text:Learning Objectives • use if/else statements to correctly match the provided target to what's stored in the program • store the input values and hard-coded values to use them in computations • potentially, store hard-coded values in a data structure that makes retrieving them easier; see the more advanced lab later. Instructions Our program will work to help people to exchange USD to the following other currencies: USD EUR CNY JPY. You can hard-code the following exchange rates for them: USD to EUR = 0.86 USD to CNY = 6.44 USD to JPY = 114.38 USD to CAD = 1.24 Note that you can hard-code these values as part of the computation or store them in a data structure that will allow you to easily retrieve them. 1. The user inputs the name of the target currency as target_currency. 2. The user inputs the amount of money they want to convert as money_amount. 3. Print the result of conversion to the user in the following format. You can compare the target_currency and all of the currencies above one by one using if statements. If the input matches the currency, the program should calculate the result and print the output. From 10 USD we will have 8.60 EUR where 10 is the input money_amount (step 2 above), and 8.60 is the the calculated result for the input target_currency (EUR). Note - all results must be always reported with 2 digits after the decimal point (i.e. the period in the number). If there is no such currency, then print Sorry, we are unable to convert USD to Y Where Y is the provided target currency. Example Input EUR 10 Example Output From 10 USD we will have 8.60 EUR
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Variables
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