Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- class PayCheck {
- public static void main(String[] args) {
- int hours, rate;
- double pay;
- String input;
- input = JOptionPane.showInputDialog("Enter your pay rate: ");
- rate = Integer.parseInt(input);
- input = JOptionPane.showInputDialog("Enter your hours: ");
- hours = Integer.parseInt(input);
- if(hours > 40) {
- pay = 40*rate + (hours-40)*rate*1.5;
- } else {
- pay = hours*rate;
- }
- JOptionPane.showMessageDialog(null,"Your pay is: " + pay);
- }
- }
Add Comment
Please, Sign In to add comment