/home/caleb/NetBeansProjects/ADSV Java/lab7_CalebFontenot/src/main/java/com/calebfontenot/lab7_calebfontenot/Bonus.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.calebfontenot.lab7_calebfontenot;

import java.util.Scanner;
import java.text.NumberFormat;

/**
 *
 * @author caleb
 */
public class Bonus {
    public static void main(String[] args)
    {
        //Setup currency formatter
        NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
        // Create scanner
        Scanner input = new Scanner(System.in);
        
        // Setup vars
        String lastName,
               firstName;
        double thisYearsUnits,
               lastYearsUnits,
               bonus = 0;
        
        // Prompt for input
        System.out.print("Enter last name: ");
        lastName = input.nextLine();
        System.out.print("Enter first name: ");
        firstName = input.nextLine();
        System.out.print("Enter this year's units: ");
        thisYearsUnits = input.nextDouble();
        System.out.print("Enter last year's units: ");
        lastYearsUnits = input.nextDouble();
        
        // Compute!
        if (thisYearsUnits > lastYearsUnits) {
            if (1000 > thisYearsUnits) // If thisYearsUnits is less than 1000
                bonus = 25;
            else if (thisYearsUnits > 1000 && thisYearsUnits < 3000) // If thisYearsUnits is more than 1000, but less than 3000
                bonus = 50;
            else if (thisYearsUnits > 3000 && thisYearsUnits < 6000) // If thisYearsUnits is more than 3000, but less than 6000
                bonus = 100;
            else if (thisYearsUnits > 6000) // 6000 and up
                bonus = 200;
        }
        
        // Output
        System.out.println("Employee Name: ");
        System.out.println("\t"+ lastName + ", " + firstName);
        System.out.println("Bonus is "+ defaultFormat.format(bonus));
        
    } 
}