Anda di halaman 1dari 8

/**

* Write a description of class Cantara_Marigondon here.

* @Cantara, Franz Ivan M. & Marigondon, Larriel Kenneth V.

* @Sep. 13, 2012

*/

import java.util.Scanner;

public class Cantara_Marigondon_FINALS_DS002L1

public static void main(String[]args)

String string = new String();

Scanner scan = new Scanner(System.in);

String FName=null;

String LName=null;

String AM,PM=null;

String shift=null;

String REL,NAT,GEN,CTY,EM,PROV=null;

int age,Payment,payment,x,netpay,choose;

int Whours=0;

int TOTALD,TNP,CN,TI,TO;

int MP=426;

int SSS,BIR,PhilHealth,PAGIBIG;

int DedSSS,DedBIR,DedPH,DedPI;
//Registration Form

System.out.println("Enter First Name: ");

FName=scan.next();

System.out.println("Enter Last Name: ");

LName=scan.next();

System.out.println("Religion: ");

REL=scan.next();

System.out.println("Nationality: ");

NAT=scan.next();

System.out.println("Gender: ");

GEN=scan.next();

System.out.println("Country: ");

CTY=scan.next();

System.out.println("State/Province: ");

PROV=scan.next();

System.out.println("E-mail: ");

EM=scan.next();

System.out.println("Contact Number: ");

CN=scan.nextInt();

System.out.println("Age: ");

age=scan.nextInt();

System.out.println("Civil Status: [1] SINGLE or [2] MARRIED ? : ");

x=scan.nextInt();
if(x!=1 && x!=2)

System.out.print("INVALID INPUT! TRY AGAIN!");

//ASK ABOUT GOTO STATEMENT OR BREAK

//Registration Form ENDS HERE

//CRITERIA B

System.out.println("Are you on [1] MORNING SHIFT or on [2] NIGHT SHIFT ? : ");

choose=scan.nextInt();

if(choose==1)

System.out.println("Enter TIME-IN in AM for MORNING SHIFTS and PM for NIGHT SHIFTS : ");

TI=scan.nextInt();

System.out.println("Enter TIME-OUT in AM for NIGHT SHIFTS and PM for MORNING SHIFTS : ");

TO=scan.nextInt();

Whours=(12-TI)+TO;

System.out.println("Your WORKHOURS is "+Whours+" hrs.");

}
else if(choose==2)

System.out.println("Enter TIME-IN in AM for MORNING SHIFTS and PM for NIGHT SHIFTS : ");

TI=scan.nextInt();

System.out.println("Enter TIME-OUT in AM for NIGHT SHIFTS and PM for MORNING SHIFTS : ");

TO=scan.nextInt();

Whours=(12-TI)+TO;

System.out.println("Your WORKHOURS is "+Whours+" hrs.");

else

System.out.println("INVALID INPUT! TRY AGAIN!");

//CRITERIA B ENDS HERE

//CRITERIA C

//426 = minimum payment/day

int Whours2=Whours;

payment=426/Whours2;

System.out.println("Your Payment per hour is "+payment);

//CRITERIA C ENDS HERE


//CRITERIA D

Payment=(Whours2*payment)*15;

System.out.println("Your Payment per PAY DAY is "+Payment);

if(x==1)

System.out.print("Enter your following DEDUCTIONS from your SALARY: ");

//ask about multiplying String to Decimal numbers

System.out.println("Formula : "+Payment+" * 0.07 ");

System.out.println("Deduction for SSS: ");

DedSSS=scan.nextInt();

System.out.println("Formula : "+Payment+" * 0.08");

System.out.println("Deduction for BIR: ");

DedBIR=scan.nextInt();

System.out.println("Formula : "+Payment+" * 0.09");

System.out.println("Deduction for PhilHealth: ");

DedPH=scan.nextInt();

System.out.println("Formula : "+Payment+" * 0.11");

System.out.println("Deduction for Pag-Ibig: ");

DedPI=scan.nextInt();
TOTALD=(DedSSS+DedBIR+DedPH+DedPI);

System.out.println("Your total DEDUCTION is: "+TOTALD);

else

System.out.println("Enter your following DEDUCTIONS from your SALARY: ");

//ask about multiplying String to Decimal numbers

System.out.println("Formula : "+Payment+" * 0.05 ");

System.out.println("Deduction for SSS: ");

DedSSS=scan.nextInt();

System.out.println("Formula : "+Payment+" * 0.06");

System.out.println("Deduction for BIR: ");

DedBIR=scan.nextInt();

System.out.println("Formula : "+Payment+" * 0.07");

System.out.println("Deduction for PhilHealth: ");

DedPH=scan.nextInt();

System.out.println("Formula : "+Payment+" * 0.09");

System.out.println("Deduction for Pag-Ibig: ");

DedPI=scan.nextInt();
TOTALD=(DedSSS+DedBIR+DedPH+DedPI);

System.out.println("Your total DEDUCTION is: "+TOTALD);

//CRITERIA D ENDS HERE

//CRITERIA C

System.out.println("TOTAL NET PAY");

netpay=Payment-TOTALD;

System.out.println("Employee "+FName+" "+LName+"'s TOTAL NET PAY ALL IN ALL is: "+netpay+" Pesos.");

}
Criteria:

A. Can accept employees records (provide a registration form)


B. Capable to compute the number of work hours of an employees (ex. 8 hours per day)
C. Capable to display the payment of an employee per working hours (ex. 450 per hour)
D. Capable to compute the deduction of an employee per pay day (ex. SSS, GSIS, PhilHealth, Pag-
ibig)

Note:

If an employee is single the deductions are:

SSS or GSIS = 7% of the given gross of salary


Pag-ibig = 8% of the given gross of salary
PhilHealth = 9% of the given gross of salary
BIR = 11% of the given gross of salary

If an employee is married the deductions are:

SSS or GSIS = 5% of the given gross of salary


Pag-ibig = 6% of the given gross of salary
PhilHealth = 7% of the given gross of salary
BIR = 9% of the given gross of salary

E. Can provide an accurate net pay of an employee including the deductions.

Anda mungkin juga menyukai