import javax.swing.*;
public class Timlon {
public static void main( String[] arg) {
String t = JOptionPane.showInputDialog("Ange antalet arbetstimmar");
String l = JOptionPane.showInputDialog("Ange timlön");
double timmar = Double.parseDouble(t);
double lon = Double.parseDouble(l);
if (timmar>=40.5){
double ot = (timmar-40);
double not = (ot*0.5);
double ol = (not*lon);
double orl = (lon*timmar);
double vl = (orl+ol);
String veckolon = String.format("Veckolönen är %.2f", vl);/
JOptionPane.showMessageDialog(null, veckolon);
}
else{//om timmarna är 40 eller mindre så veckolönen lon*timmar
double vl = (timmar*lon);
String veckolon = String.format("Veckolönen är %.2f", vl);
JOptionPane.showMessageDialog(null, veckolon);
}
}
}