Java: Calculate Payment

 

 

 

 

Here is the CalPayRate.java source code

import static java.lang.System.out;import javax.swing.JOptionPane;
public class CalPayRate {  
  
  public static void main(String[] args) { 
     int hours = Integer.parseInt(JOptionPane.showInputDialog("Enter Hours:"));
     double rate = Double.parseDouble(JOptionPane.showInputDialog("Enter Rate:"));
     
     double pay = rate * hours;
       
     JOptionPane.showMessageDialog(null, "The result is "+pay); 
  }
}