Write a Java that prompts the user like this: “Currency to convert to U.S. dollars: e = Euros, c= Chinese Yuan, r = Indian Rupees, b = Bitcoin: ”. Then depending on which letter the user enters, the program displays “Amount of Euros/Yuan/Rupees/Bitcoin to convert: ”. (Note: the second prompt should only name the one currency the user asked to convert, not all four currencies.) After the user enters the amount, the program displays “In U.S. dollars, that is $N”, (N is the amount converted to U.S. dollars).
1 Euro = 1.16 US dollar
1 Chinese yuan = 0.15 US dollar
1 Indian rupee = 0.015 US dollar
1 Bitcoin = 6923.80 US dollar
import java.util.*;
public class Main
{
public static void main(String[] args) {
System.out.print("Currency to
convert to U.S. dollars: e = Euros, c= Chinese Yuan, r = Indian
Rupees, b = Bitcoin:");
Scanner sc = new
Scanner(System.in);
char c;
c= sc.next().charAt(0);
double d=0;
if(c=='e')
{
System.out.print("Enter amount in
Euros:");
d=sc.nextDouble();
d=d*1.16;//converting to us
dollars
}
else if(c=='c')
{
System.out.print("Enter amount in
Yuans:");
d=sc.nextDouble();
d=d* 0.15 ;//converting to us
dollars
}
else if(c=='r')
{
System.out.print("Enter amount in
Rupees:");
d=sc.nextDouble();
d=d*0.015 ;//converting to us
dollars
}
else
{
System.out.print("Enter amount in
Bitcoins:");
d=sc.nextDouble();
d=d*6923.80;//converting to us
dollars
}
System.out.println("In U.S.
dollars, that is $"+d);
}
}
output:
Currency to convert to U.S. dollars: e = Euros, c= Chinese Yuan, r = Indian Rupees, b = Bitcoin:r
Enter amount in Rupees:200
In U.S. dollars, that is $3.0
Write a Java that prompts the user like this: “Currency to convert to U.S. dollars: e...
VII JAVA ASSIGNMENT. Write a program with a graphical interface that allows the user to convert an amount of money between U.S. dollars (USD), euros (EUR), and British pounds (GBP). The user interface should have the following elements: a text box to enter the amount to be converted, two combo boxes to allow the user to select the currencies, a button to make the conversion, and a label to show the result. Display a warning if the user does not...
Currencies-U.S. dollar foreign-exchange rates. Country/currency in US$ per USS Chinese Yuan 0.1466 6.8213 Indian Rupee 0.0201 49.7512 Euro 1.3265 0.7539 Suppose a Big Mac costs $3.27 in Boston, and $2.69 in Paris. In this circumstance, what can we say is TRUE? a. Purchasing Power Parity does not hold, and Big Macs are relatively expensive in Boston. b. Purchasing Power Parity does not hold, and Big Macs are relatively cheap in Boston. c. Purchasing Power Parity holds, and Big Macs are...
JAVA: Using the forex.csv Given a file with the USD to conversion rate Convert X amount of Currency A to Currency B User inputs are the source and destination currency symbols and the amount. $3000 AUD = $42,641.40 MXN Symbol Currency Dollar USD US Dollar 1 EUR Euro 0.842850125 GBP British Pound 0.761549464 INR Indian Rupee 63.72054347 AUD Australian Dollar 1.259237335 CAD Canadian Dollar 1.257801755 SGD Singapore Dollar 1.359074339 CHF Swiss Franc 0.970036942 MYR Malaysian Ringgit 4.280492421 JPY Japanese Yen...
please write code in java language and do not add any break,
continue or goto statements
Write a program with a graphical interface that allows the user to convert an amount of money between U.S. dollars (USD), euros (EUR), and British pounds (GBP). The user interface should have the following elements: a text box to enter the amount to be converted, two combo boxes to allow the user to select the currencies, a button to make the conversion, and a...
Part 2. Cross rates The highest bid and lowest ask in the NY currency market for the listed currencies: Australian dollar AUD/USD 0.7190 Chinese yuan USD/CNY 6.7473 Danish krone USD/DKK 6.5451 Euro EUR/USD 1.1415 Jamaican dollar USD/JMD 132.88 Japanese yen USD/JPY 109.55 New Zealand dollar NZD/USD 0.6839 West African franc USD/XOF 279.50 1 a. What is the implied cross rate prices for exchanging euros and West African francs? Which currency should be the base currency in this cross rate? b....
Your task: You purchased some sporting goods, but you want to know how much you would have spent using different currencies. Review the exchange rates listed below, then look at your receipt to see how much each item cost you in U.S. dollars. 1. Calculate the cost of each item in Euros, Canadian dollars, and Chinese yuan. 2. Add the last column down to figure out the total money spent in each currency Happy Sporting Goods Receipt Exchange rates Tennis...
Can someone modify my code so that I do not get this error: Exception in thread "main" java.lang.NullPointerException at java.awt.Container.addImpl(Container.java:1043) at java.awt.Container.add(Container.java:363) at RatePanel.<init>(RatePanel.java:64) at CurrencyConverter.main(CurrencyConverter.java:16) This code should get the amount of money in US dollars from user and then let them select which currency they are trying to convert to and then in the textfield print the amount //********************************************************************* //File name: RatePanel.java //Name: Brittany Hines //Purpose: Panel for a program that convers different currencyNamerencies to use dollars //*********************************************************************...
Please Only Answer Parts C, D and E 1. Given below are a set of foreign exchange quotes for several currencies against the Australian dollar as of May 15, 2019. Australian Dollar Exchange Rates Currency Sell/buy US, dollar 0.6926/0.6928 UK, pound 0.5366/5369 China, yuan Renminbi 4.7528/4.7569 Fiji, dollar 1.4708/1.5263 India, rupee 48.628/48.648 New Zealand, dollar 1.0548/1.0556 Papua New Guinea, kina 2.2745/2.4097 Singapore, dollar 0.9477/0.9483 Sri Lanka, rupee 121.967/122.21 Switzerland, franc 0.6979/0.6984 (a) Are these direct or indirect quotes from the...
Write a program that will convert U.S. dollar amounts to Japanese yen and to euros, storing the conversion factors in the constants YEN_PER_DOLLAR and EUROS_PER_ DOLLAR. To get the most up-to-date exchange rates, search the Internet using the term “currency exchange rate”. If you cannot find the most recent exchange rates, use the following: 1 Dollar = 98.93 Yen 1 Dollar = 0.74 Euros Format your currency amounts in fixed-point notation, with two decimal places of precision, and be sure...
8. Bloomberg Currency Cross Rates. Use the table at the top of the page from Bloomberg to calculate each of the following: a. Japanese yen per U.S. dollar? b. U.S. dollars per Japanese yen? c. U.S. dollars per euro? d. Euros per U.S. dollar? e. Japanese yen per euro? f Euros per Japanese yen? g. Canadian dollars per U.S. dollar? h. U.S. dollars per Canadian dollar? i. Australian dollars per U.S. dollar? j. U.S. dollars per Australian dollar? k. British...