Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a JAVA program that helps the user convert currency. The user will enter t

ID: 3549869 • Letter: W

Question

Write a JAVA program that helps the user convert currency. The user will enter the amount in Kuwaiti dinars. The program will print the equivalent amount in US dollar and Euros count his change.

Assume that the exchange rate for US dollar is 3.54 and 2.59


Sample output:

Hello, welcome to Currency converter

How many Kuwaiti dinars you have? 15.5

15.5 KD is equal to 53.14 US dollars and 40.18Euro

Write a JAVA program that helps the user convert currency. The user will enter the amount in Kuwaiti dinars. The program will print the equivalent amount in US dollar and Euros count his change

Explanation / Answer

please rate - thanks


import java.util.*;
import javax.swing.*;
import java.lang.*;
import java.text.*;
public class converter
{
public static void main(String []args)
{DecimalFormat df = new DecimalFormat("#.##");
String input = JOptionPane.showInputDialog(null, "Hello, welcome to Currency converter. How many Kuwati dinars do you have? ");
double dinars=Double.parseDouble(input);
double dollars=dinars*3.54;
double euros=dinars*2.59;
JOptionPane.showMessageDialog(null,dinars+" KD is equal to "+df.format(dollars)+" US dollars and "+df.format(euros)+" Euro");
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote