Payroll2 - package payroll2*Trinity Martin Week 01 Lab 1.2...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package payroll2; p /**Trinity Martin * Week 01 * Lab 1.2 Task 2 * This program calculates a payroll statement based on the users input.It does so with a GUI. */ import javax.swing.JOptionPane; public class Payroll2 { public static void main(String[] args){ //Enter the employees last name for dialog String employee = JOptionPane.showInputDialog("Please enter employees full last name: "); //Enter the total hours worked for dialog String hoursString = JOptionPane.showInputDialog("Please enter the total hours worked: "); //converts the string to an integer int hours = Integer.parseInt(hoursString); //Enter the hourly pay rate for dialog String hourlyRateString = JOptionPane.showInputDialog("Please enter the hourly pay rate:$ "); //Converts the string to a double double hourlyRate = Double.parseDouble(hourlyRateString); //Enter the amount of federal taxes for dialog String federalTaxesString = JOptionPane.showInputDialog("Please enter the federal tax in decimal form, for instance .10 for 10%: ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online