Created
October 30, 2014 13:14
-
-
Save SniperProSerria117/be545a641552ba94d5e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package payroll; | |
import javax.swing.JOptionPane; | |
public class PayRoll { | |
public static void main(String[] args) { | |
String inputString; | |
String name; | |
int hours; | |
double payRate; | |
double grossPay; | |
name = JOptionPane.showInputDialog("What is " + | |
"your name? "); | |
inputString = | |
JOptionPane.showInputDialog("How many hours " + | |
"did you work this week? "); | |
hours = Integer.parseInt(inputString); | |
inputString = | |
JOptionPane.showInputDialog("What is your" + | |
" hourly pay rate? "); | |
payRate = Double.parseDouble(inputString); | |
grossPay = hours * payRate; | |
JOptionPane.showMessageDialog(null, "Hello " + | |
name +". Your gross pay is $" + | |
grossPay); | |
System.exit(0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment