You are on page 1of 3

/**

* Write a description of class Act5F here.


*
* @author (your name)
* @version (a version number or a date)
*/
import java.util.Scanner;
public class Act5F {

// Define all arrays here

static String empName[] = {"Duterte, Rodrigo", "Escudero, Francis",


"Drilon, Franklin", "Trillanes, Sonny", "Pacquiao, Manny", "Dela Rosa, Bato", "Poe,
Grace", "Lacson, Ping"};
static int empNo[] = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008};
static int hour[] = {300, 200, 300, 400, 400, 100, 300, 200};
static int Mon[] = {8, 7, 8, 8, 8, 8, 8, 5};
static int Tue[] = {8, 5, 8, 8, 8, 8, 8, 5};
static int Wed[] = {6, 8, 8, 8, 8, 8, 8, 5};
static int Thu[] = {8, 8, 6, 8, 8, 8, 8, 5};
static int Fri[] = {5, 8, 6, 8, 8, 8, 8, 8};
static int Sat[] = {3, 4, 1, 0, 5, 3, 5, 5};
static int Sun[] = {3, 4, 5, 0, 2, 0, 0, 8};
// Define all methods here
static void pressAnyKey(){
System.out.println("\n\nEnter Any Key to Continue\n\n");
Scanner in = new Scanner(System.in);
in.nextLine();
}
static void prtEmployees() {
for (int i = 0; i<empName.length;i++)
{
System.out.println(empName[i]);
}
pressAnyKey();
}

static void prtHours() {


Scanner in = new Scanner(System.in);
for (int i = 0; i<empName.length;i++)
{
System.out.println("[" + (i+1) + "] "+ empName[i]);
}
System.out.println("choose employee: ");
int option = in.nextInt();
System.out.println(empName[option - 1]);
System.out.println("Hours worked: ");
System.out.println("Mon: " + Mon[option - 1]);
System.out.println("Tue: " + Tue[option - 1]);
System.out.println("Wed: " + Wed[option - 1]);
System.out.println("Thu: " + Thu[option - 1]);
System.out.println("Fri: " + Fri[option - 1]);
System.out.println("Sat: " + Sat[option - 1]);
System.out.println("Sun: " + Sun[option - 1]);
pressAnyKey();
}

static void prtTotalRegHrs() {


Scanner in = new Scanner(System.in);
for (int i = 0; i<empName.length;i++)
{
System.out.println("[" + (i+1) + "] "+ empName[i]);
}
System.out.println("choose employee: ");
int option = in.nextInt();
System.out.println(empNo[option - 1]);
System.out.println(empName[option - 1]);
System.out.println("Total Hours (M-F): ");

System.out.println(Mon[option - 1] + Tue[option - 1] + Wed[option - 1] +


Thu[option - 1] + Fri[option - 1]);
pressAnyKey();
}

static void prtOTHrs() {


Scanner in = new Scanner(System.in);
for (int i = 0; i<empName.length;i++)
{
System.out.println("[" + (i+1) + "] "+ empName[i]);
}
System.out.println("choose employee: ");
int option = in.nextInt();
System.out.println(empNo[option - 1]);
System.out.println(empName[option - 1]);
System.out.println("Total Hours (Sat-Sun): ");

System.out.println(Sat[option - 1] + Sun[option - 1]);


pressAnyKey();
}

static void prtPayroll() {


Scanner in = new Scanner(System.in);
for (int i = 0; i<empName.length;i++)
{
System.out.println("[" + (i+1) + "] "+ empName[i]);
}
System.out.println("choose employee: ");
int option = in.nextInt();
int regularHours = Mon[option - 1] + Tue[option - 1] + Wed[option - 1] +
Thu[option - 1] + Fri[option - 1];
int OTHours = Sat[option - 1] + Sun[option - 1];
int regularPay = regularHours * hour[option - 1];
double OTPay = OTHours * hour[option - 1] * 1.25;
double grossPay = regularPay + OTPay;
double Tax = grossPay * .10;
double Netpay = grossPay - Tax;

System.out.println("Regular Hours: " + regularHours);


System.out.println("OT Hours: " + OTHours);
System.out.println("Regular Pay: " + regularPay);
System.out.println("Overtime Pay: " + OTPay);
System.out.println("Grosspay: " + grossPay);
System.out.println("Tax: " + Tax);
System.out.println("Netpay: " + Netpay);
pressAnyKey();
}
// Define main method here
static void abtMe() {
System.out.println("Activity 5 for Finals");
System.out.println("December 12, 2022");
System.out.println("Developer: Kem De Guzman");
pressAnyKey();
}

public static void main ( String[] args ) {


Scanner in = new Scanner(System.in);
int option;
do{
System.out.println("\n\n\t\tComputerized Payroll Processing and
Reporting");
System.out.println("\n\n\t\tMain Options\n\n");

System.out.println("1 - Display All Employees");


System.out.println("2 - Display Employee Hours Worked Per
Day");
System.out.println("3 - Display Total Regular Hours Worked");
System.out.println("4 - Display Total Overtime Hours Worked");
System.out.println("5 - Display Payroll Report");
System.out.println("6 - About Me");
System.out.println("7 - End");

System.out.print("\n\n\t\tChoose an option: \n\n");


option = in.nextInt();
switch (option)
{
case 1: prtEmployees(); break;
case 2: prtHours(); break;
case 3: prtTotalRegHrs(); break;
case 4: prtOTHrs(); break;
case 5: prtPayroll(); break;
case 6: abtMe(); break;
case 7: System.exit(0);
}
}while(option != 7);
}

You might also like