Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

A salesperson will continue to earn a fixed salary of $50,000. The current sales target for every salesperson is $80,000.

  • The sales incentive will only start when 80% of the sales target is met. The current commission is 12% of total sales.
  • If a salesperson exceeds the sales target, the commission will increase based on an acceleration factor. The acceleration factor is 1.3.
  • The application should ask the user to enter annual sales, and it should display the total annual compensation.
  • The application should also display a table of potential total annual compensation that the salesperson could have earned, in $5000 increments above the salesperson's annual sales, until it reaches 50% above the salesperson's annual sales.

Sample Table: Assuming a salesperson's annual sales of $100,000, the table would look like this:

Total Sales

Total Compensation

100,000

<>

105,000

<>

110,000

<>

115,000

<>

120,000

<>

125,000

<>

130,000

<>

135,000

<>

140,000

<>

145,000

<>

150,000

<>

  • The application will now compare the total annual compensation of at least two salespersons.
  • It will calculate the additional amount of sales that each salesperson must achieve to match or exceed the higher of the two earners.
  • The application should ask for the name of each salesperson being compared.

The JavaTM application should also meet these technical requirements:

·         The application should have at least one class, in addition to the application's controlling class

Here is what I have so far - but am lost on how to compare at least two salespeople.

/*************************************************************
* Roy Gibson
* annual compensation of a salesperson
* PRG/420 Computer Programming I
*
*
***************************************************************/

public class Compensation
{
    private double annualSalary;
    private double annualSales;
    private double commissionPercent;
    private double accelerationFactor;

    // Constructor
    Compensation()
    {
        annualSalary = 0;
        annualSales = 0;
        commissionPercent = 0;
        accelerationFactor = 0;
    }

    Compensation(double aSalary, double aSales, double aCommPercent, double aAccelerationFactor)
    {
        annualSalary = aSalary;
        annualSales = aSales;
        commissionPercent = aCommPercent;
        accelerationFactor = aAccelerationFactor;
    }

    // Public Methods
    public void setAnnualSalary(double aSalary)
    {
        annualSalary = aSalary;
    }

    public void setAnnualSales(double aSales)
    {
        annualSales = aSales;
    }

    public void setCommissionPercent(double aCommPercent)
    {
        commissionPercent = aCommPercent;
    }

    public void setAccelerationFactor(double aAccFactor)
    {
        accelerationFactor = aAccFactor;
    }

    public double getAnnualSales()
    {
        return annualSales;

/*************************************************************
*Roy Gibson
*
* PRG/420 Computer Programming I
*
*
***************************************************************/

import java.text.*;
import java.io.*;
import java.util.*;

class PRG420Week3
{
    /*************************************************************
    * Main () function.
    *
    *
    **************************************************************/

    public static void main(String[] args)
    {
        //Create a new instance of the main class object
        Compensation obj = new Compensation ();

        /*************************************************************
        * call the functions passing it the needed constants.
        *
        **************************************************************/

        obj.setAnnualSalary (50000);
        obj.setCommissionPercent (0.12);
        obj.setAccelerationFactor(1.3);

        int sales;
        Scanner keyboard = new Scanner(System.in);
        System.out.print("Enter the total sales in integer value: $");
        sales = keyboard.nextInt();

        obj.setAnnualSales((double)sales);

        /*************************************************************
        * call the functions to calculate compensation, based on input
        * earlier.
        **************************************************************/
        double total = obj.calculateCompensation ();

        System.out.println("The total compensation is: $" + total + "\n");

        /*************************************************************
        * call the functions to calculate compensation table
        *
        **************************************************************/
        NumberFormat theNumberFormat = NumberFormat.getCurrencyInstance();

        // Output table header. Use tab escape \t to create even spacing.
        System.out.println("Total Sales\t\tTotal Compensation");
        System.out.println("-----------\t\t------------------");

        int step = 5000;

        // Create stopping point for while loop that is 50% higher than annual sales.
        double anchor = obj.getAnnualSales() * 1.5;

        do
        {
            obj.setAnnualSales(obj.getAnnualSales() + step);
            System.out.println(theNumberFormat.format(obj.getAnnualSales()) + "\t\t" + theNumberFormat.format(obj.calculateCompensation()));
        } while (obj.getAnnualSales() < anchor);
    }
}

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9887199

Have any Question?


Related Questions in Computer Engineering

Assignmentnbspon information systems audit and

Assignment  on Information Systems audit and controls  Assignment purpose: Elaborate on the different types of control that are applied in a hospital (Preventive, detective and corrective control). Evaluate the logical a ...

The single-cycle design on p 17 of the notes is capable of

The single-cycle design on p. 17 of the notes is capable of performing more instructions than the subset that were discussed in §4.1 of the lecture notes. Open the MIPS Architecture Volume II-A: The MIPS32 Instruction Se ...

It has been argued that although there may be more claims

It has been argued that although there may be more claims when road conditions are slippery in the winter, this should not affect the average claim. Malpeque took a sample of 50 claims from the winter of 2018 and found t ...

Terry amp sons makes bearings for autos the production

Terry & Sons makes bearings for autos. The production system involves two independent processing machines so that each bearing passes through these two processes. The probability that the first processing machine is not ...

Suppose that you need to create two-table database to

Suppose that you need to create two-table database to record information for a DVD rental kiosk. The following information needs to be recorded. For all movies: Movie number, title, category, rental rate, and whether or ...

Question the three as of security are authentication

Question: The three A's of security are Authentication, Authorization, and Auditing. Write a 1-2 page paper in APA format describing these techniques and how they are used in your organization. What could be improved? Th ...

Risk management software is a critical application that

Risk management software is a critical application that businesses use to gain insight on how risk drivers can impact a project and business. For this research assignment, you will do an internet search for "risk managem ...

Question suppose a prolog database exists that gives

Question : Suppose a Prolog database exists that gives information about the parts in an automobile engine. Predicates of big, small, and part-of are included. a. Write a query to find all small items that are part of ot ...

Please discuss the followingas demand increased for these

Please discuss the following: As demand increased for these mortgage backed securities, lenders reacted by relaxing their approval standards to increase production. No longer were "all" borrowers required to document the ...

Recall that the op-code and operand are represented in

Recall that the op-code and operand are represented in memory by HEX numbers (e.g., LDAA $3000 will show in memory as $B6, $30, and $00). Write a short program to use the commands LDAA and STAA to load and store a value ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As