import java.util.Scanner;
import java.time.LocalDate;
import java.time.Period;
/**
*Program generates pay stub for employee.
*Details several variables.
* @author Taylor Schaefer ts1178
* @version 19
*/
public class PayStub {
/**
* @param args insert description here
*/
public static void main(String[] args) {
//Install scanner and declare all variable
Scanner keyboard = new Scanner(System.in);
//Inputting name
System.out.print("Enter your Fullname:");
String fullName = keyboard.nextLine();
//Inputting anniversary month
System.out.print("Enter your Anniversary Month(1-12):");
int month = keyboard.nextInt();
//Inputting anniversary year
System.out.print("Enter your Anniversary Year:");
int year = keyboard.nextInt();
//Hours per week worked
System.out.print("Enter your hours worked this pay period(0-350):");
int hours = keyboard.nextInt();
//Inputting name
System.out.print("Enter your Job Title:");
String blank = keyboard.nextLine();
String jobTitle = keyboard.nextLine();
//Hourly pay rate
System.out.print("Enter your pay rate:");
double rate = keyboard.nextDouble();
//current pay month 9
//current pay year 2018
int day = 1;
LocalDate start = LocalDate.of(year, month, day);
LocalDate today = LocalDate.of(2018, 9, 1);
//calculate the time that has passed
Period age = Period.between(start, today);
int years = age.getYears();
int months = age.getMonths();
//Print total number of months worked and declare variable total months
int totalMonths = months + years * 12;
//Declare Variable vacation Hours
double vacation = totalMonths * 8.25;
//Declare and define gross pay
double grossPay = hours * rate;
//Declare and calculate retirement
double retirement = grossPay * .052;
//Declare and calculate tax withholding
double tax = (grossPay - retirement) * .28;
//Declare and calculate net pay
double netPay = grossPay - (tax + retirement);
//Print Payroll
//
System.out.println();
System.out.println();
System.out.println("==========================================");
//Company Name
System.out.println(" Gekko & Co.");
System.out.println();
//Print Logo
System.out.println(""$"");
System.out.println(" ~~~");
System.out.println(" / `.");
System.out.println(" / /");
System.out.println(" /_ _ _ /");
System.out.println(); //divider
//Single Line Divider
System.out.println("------------------------------------------");
//Print Pay Period
System.out.println("Pay Period: 9/2018");
//Print Name
System.out.println("Name:" + fullName);
//Print Title
System.out.println("Title:" + jobTitle);
//Print anniversary month and year
System.out.println("Anniversary:" + month +"/" + year);
//Print months worked
System.out.println("Months Worked:" + totalMonths +" months");
//Print vacation hours earned
System.out.printf("Vacation hours: %.2fn", vacation);
//Single Line Divider
System.out.println("------------------------------------------");
//Print Gross Pay
System.out.printf("Gross Pay: $%.2fn", grossPay);
//Print Retirement Amount
System.out.printf("Retirement: $ %.2fn", retirement);
//Print Tax withholding amount
System.out.printf("Tax: $%.2fn", tax);
//Single Line Divider
System.out.println("------------------------");
//Print Net Pay
System.out.printf("Net Pay: $%.2fn", netPay);
//Print Footer
System.out.println("==========================================");
}
}