Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Comet;
- import java.util.Scanner;
- public class comet_class {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String employeeIdentity;
- String projectCode;
- double billableHours = 0;
- double totalBillable = 0;
- double averageBillable = 0;
- double overtimeHours = -30;
- double overtimeBonus = 0;
- double nonBillableHours = 7.5;
- System.out.println("Enter Employee Code");
- employeeIdentity = sc.next();
- //Days for Loop
- for(int i = 1; i < 5; i++) {
- // Hours for loop also used for project numbering
- for (int p = 1; p < 4; p++){
- // Project Code Input
- System.out.println("Day " +i+ " Enter Project Code "+p);
- projectCode = sc.next();
- // Skipping day if project code equals ZZ
- if(projectCode.equals("ZZ")) {
- break;
- //Print line for hours worked on project
- }
- else {
- System.out.println("Enter Hours Worked on Project "+p);
- billableHours = sc.nextDouble();
- //If the hours are above 30 the overtime hours are counted
- }
- if(totalBillable > 30);
- overtimeHours = totalBillable + overtimeHours;
- //If they are less than 30 overtime hours remain at 0
- if(totalBillable <= 30);
- overtimeHours = 0;
- totalBillable = totalBillable + billableHours;
- averageBillable = totalBillable/i;
- overtimeBonus = 20*overtimeHours;
- }
- //end of day
- billableHours = 0;
- }
- //end of week print outs
- System.out.println("\nTotal Billable Hours: " +totalBillable);
- System.out.println("Total Non-Billable Hours: "+nonBillableHours);
- System.out.println("Total Overtime Hours: "+overtimeHours);
- System.out.println("Average Daily Billable Hours Worked: "+averageBillable);
- System.out.println("Project with most hours in 1 Day: ");
- System.out.println("Bonus: €"+overtimeBonus);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement