Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lessons;
- import javax.swing.JOptionPane;
- public class PayrollDialog
- {
- //ask for name, hours worked, and payrate, then greets them withtheir name and gross pay
- public static void main(String[] args)
- {
- String name, hour, rate;
- double hours, rates, gross;
- name = JOptionPane.showInputDialog("hello, whats your name?");
- hour = JOptionPane.showInputDialog("how many hours have you worked?");
- hours = Double.parseDouble(hour);
- rate = JOptionPane.showInputDialog("whats your pay rate?");
- rates = Double.parseDouble(rate);
- gross = rates*hours;
- JOptionPane.showMessageDialog(null, "greetings "+name+", youve made $"+gross);
- System.exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement