/home/caleb/NetBeansProjects/ADSV Java/lab7_CalebFontenot/src/main/java/com/calebfontenot/lab7_calebfontenot/Bonus.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package com.calebfontenot.lab7_calebfontenot;
import java.util.Scanner;
import java.text.NumberFormat;
@author
public class Bonus {
public static void main(String[] args)
{
NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
Scanner input = new Scanner(System.in);
String lastName,
firstName;
double thisYearsUnits,
lastYearsUnits,
bonus = 0;
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();
if (thisYearsUnits > lastYearsUnits) {
if (1000 > thisYearsUnits)
bonus = 25;
else if (thisYearsUnits > 1000 && thisYearsUnits < 3000)
bonus = 50;
else if (thisYearsUnits > 3000 && thisYearsUnits < 6000)
bonus = 100;
else if (thisYearsUnits > 6000)
bonus = 200;
}
System.out.println("Employee Name: ");
System.out.println("\t"+ lastName + ", " + firstName);
System.out.println("Bonus is "+ defaultFormat.format(bonus));
}
}