I couldn’t figure out how to do this please help!
public class PayCheckWeek7
public static void main(String args)
String input = JOptionPane.showInputDialog("What's your name?");
String input1 = JOptionPane.showInputDialog("What's your hourly wage?");
double n = Double.parseDouble(input1);
String input2 = JOptionPane.showInputDialog("how many hours you worked in the past week?");
double m = Double.parseDouble(input2);
if (m > 40)
JOptionPane.showMessageDialog (null,"your wage this week is: " + ((n*m)*1.5));
JOptionPane.showMessageDialog (null,"your wage this week is: " + (n*m));
I need to modify the above program. The functionality of the new program should be exactly the same. However, write a method called
calculatePay, which calculates the total amount of pay. Call this method
from within the main method, and display its return value.