I'm pretty new on programming overall, especially Java Swing, but i want to make a basic currency converter that calculates how many dollars, euros and pounds you get for an ammount of Swedish crones.
import javax.swing.*;
public class Currency{
public static void main (String[] arg) {
int v, dollar, euro, pound;
String indata;
indata = JOptionPane.showInputDialog(null,
"How many Swedish crones would you like to exchange: ", "Currency-converter",JOptionPane.QUESTION_MESSAGE);
v = Double.parseDouble(indata);
dollar = (v * 7,1);
euro = (v * 10,2);
pound = (v * 11,3);
JOptionPane.showMessageDialog(null, v + " Your ammount is equal to:" + "/nDollar: " + dollar + "/nEuro: " + euro + "/nPound: " + pound,
"Currency-converter", JOptionPane.PLAIN_MESSAGE );
System.exit(0);
}
}
Whenever i try to compile the program it says "; missing" on the dollar/euro/punds = (v * XX) lines", and i fail to see where the problem is. I might be way off with the entire code, but any help appriciated!
Thanks.


Sign In
Create Account

Back to top









