im doing a program which has two different questions, ohm and ampere to be exact. i know how to make this work but the problem is that in the end one more question should pop up asking " do u want to make a new calculation?" this question should work like if i press "Y" the program should continue from the beginning and if i press "N" the program should exit.
I hope anyone got some ideas that could help me finish this. And the program has to be in JOptionpane.dialog/message format.
//delajz
this is what i got atm.
//Declaring Variables
Ampere = Integer.parseInt(FragaAm);
Ohm = Integer.parseInt(FragaOhm);
//koden
do
{
FragaAm =JOptionPane.showInputDialog("Hur många Ampere? ");
FragaOhm = JOptionPane.showInputDialog("hur hög resistans? ");
svar = Ohm*Ampere; //calculate
slutsvar = svar + "Volt"; //answer
JOptionPane.showMessageDialog(null,slutsvar);
borjaom =JOptionPane.showInputDialog("Igen? J eller N " ); // the question which ask for new calc
} while ( borjaom == "j" ||borjaom == "J" );
}
}