Question: Write a script that converts between US dollars and Euros. ( Use a rate of 1 US = 0 . 7 E for this exercise.

Write a script that converts between US dollars and Euros. (Use a rate of 1 US =0.7 E for this exercise.) The script should take one numerical required argument and one optional argument (the currency, E or US). If the user gives two arguments, perform the conversion. If the user gives only one argument, a number, assume the number is given in US dollars, warn the user, and perform the conversion. If the user gives no arguments, print a statement explaining how to run it. Examples of test cases and resulting output are shown below: Input Output 45.32 E 45.32 Euros is equivalent to 64.74 US Dollars 55 Since you didnt specify a currency, Im assuming US to Euros. 55 US Dollars is equivalent to 38.5 Euros 100 US 100.00 US Dollars is equivalent to 70.00 Euros (No arguments) Usage: number {currency (US or E)} Example: 100 US

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!