Question: Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Chinese RMB. Prompt the user to enter

Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Chinese RMB. Prompt the user to enter 0 to convert from U.S. dollars to Chinese RMB and 1 to convert from Chinese RMB and U.S. dollars. Prompt the user to enter the amount in U.S. dollars or Chinese RMB to convert it to Chinese RMB or U.S. dollars, respectively. Here are the sample runs:

Enter the exchange rate from dollars to RMB: 6.81 -Enter Enter 0

to convert dollars to RMB and 1 vice versa: Enter the dollar

Enter the exchange rate from dollars to RMB: 6.81 -Enter Enter 0 to convert dollars to RMB and 1 vice versa: Enter the dollar amount: JEnter 100 -Enter $100.0 is 681.0 yuan Enter the exchange rate from dollars to RMB: 6.81 JEnter Enter 0 to convert dollars to RMB and 1 vice versa: 5 -Enter Enter the RMB amount: 10000 is $1468.43 Enter 10000.0 yuan Enter the exchange rate from dollars to RMB: 6.81 -Enter Enter 0 to convert dollars to RMB and 1 vice versa: JEnter Incorrect input

Step by Step Solution

3.40 Rating (184 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Currency Exchange Program plan Prompt the user to enter choice and exchange rate Convert from dollar... View full answer

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 Java Programming Questions!