You must create a program named CurrencyConversion.java that converts money betw
ID: 661356 • Letter: Y
Question
You must create a program named CurrencyConversion.java that converts money between the following currencies.
Given one of the three currencies, the program should convert the input amount into one of the other currencies. For example, if you input one (1) U.S. dollar, and you decide to convert that one dollar to a pound, then the output should be .60.
Using the JOptionPane GUI, do the following.
Prompt the user for the currency code type.
Prompt the user for the amount of that currency.
Prompt the user for the currency code that the entered amount must be converted to.
Using the table above, the following formula was used to convert USD to JPY.
10.00 * 103.73 = 1,037.30
Display the results in a JOptionPane message box.
Explanation / Answer
#include #include #include void main() { int r,d,t,code; printf("enter your code 1 for rupees to dollar 2 for dollar to rupee"); scanf("%d",&code); if(code==1) { printf("enter your amount"); scanf("%d",&r); d=r/(45); printf("you have dollar %d",d); } elseif (code==2) { printf("enter your amount"); scanf("%d",&d); r=d*(45); printf("you have rupees %d",r); } else printf("invalid code"); getch(); }Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.