Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package payroll;
- /**
- *
- * @author crist
- */
- import java.util.Scanner;
- public class Payroll {
- public static int employeeId[]= {5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489};
- public static final int[] hours = new int[7];
- public static final double[] payRate = new double[7];
- public static final double[]wages = new double [7];
- public static Scanner input = new Scanner(System.in);
- public static void main(String[] args) {
- System.out.println("Hello, here are the employee's # ID");
- for (int i = 0; i < employeeId.length; i++) {
- System.out.printf(employeeId[i] + " \t " );
- System.out.println(" ");}
- for (int a = 0; a < hours.length; a++) {
- System.out.println("Enter employee " + (a+1
- ) + " number of hours. (No less than 0 hours)");
- hours[a] = input.nextInt();
- if (hours[a] < 0) {
- a--;
- System.out.println("Error, Invalid Input. Re-Enter hours between 0 and β.");
- } else {
- System.out.println("Enter employee " + (a+1) + " Payrate. (No less than 6$ per hour)");
- payRate[a]= input.nextDouble();
- if (payRate[a] < 6.00) {
- a--;
- System.out.println("Error, Invalid Input. Re-Enter payrate between 6 and β.");
- } else {
- System.out.println(" ");
- }
- }
- }
- System.out.println("Employee's ID " + " \t Gross wages ");
- for (int i = 0; i < employeeId.length; i++) {
- wages[i] = (double)(hours[i] * payRate[i]);
- System.out.println(employeeId[i] + "\t \t \t " + wages[i] + "$");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement