Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package salesperson;
- /**
- *
- *
- * @author Josue Saldivar
- */
- import java.util.Scanner; //allows for user input
- public class SalesPerson //a class is created called SalesPerson
- {
- //main method is created for execution of body
- public static void main(String[] args) {
- //scanner java class to get user input from console
- Scanner scnConsole = new Scanner(System.in);
- System.out.println("Please enter your annual sales:");
- String strUserInput = scnConsole.next();
- //String is converted to Double for usability
- Double.parseDouble(strUserInput);
- //the users input is stored within annualSales
- double annualSales = Double.parseDouble(strUserInput);
- double totalComp;
- double fixedSalary = 35750;
- double commissionRate = 0.12;
- double commIncRate = .1375;
- int i = 0;
- while(i < 1)
- {
- i = i +1;
- if (annualSales >= 125250.00)
- {
- totalComp = (annualSales * commIncRate) + fixedSalary;
- System.out.println("You met or exceeded the sales target!");
- System.out.println("Your commission of $" + totalComp);
- System.out.println("Has increased 1.25% above original 12%!");
- }
- if (annualSales <= 100199.99)
- {
- System.out.println("Sorry, you did not earn a commission.");
- }
- if (annualSales < 125250.00 && annualSales >= 100200.00)
- {
- totalComp = (annualSales * commissionRate) + fixedSalary;
- System.out.println("Your total compensation is");
- System.out.println("$" + totalComp);
- System.out.println("The total of your annual compensation is");
- System.out.println("Your salary plus 12% of your annual sales.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement