Display the total annual compensation

Assignment Help Basic Computer Science
Reference no: EM13307881

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

<<Program calculated value>>

105,000

<<Program calculated value>>

110,000

<<Program calculated value>>

115,000

<<Program calculated value>>

120,000

<<Program calculated value>>

125,000

<<Program calculated value>>

130,000

<<Program calculated value>>

135,000

<<Program calculated value>>

140,000

<<Program calculated value>>

145,000

<<Program calculated value>>

150,000

<<Program calculated value>>

  • 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);
    }
}

 

Reference no: EM13307881

Questions Cloud

Write a method named maxelement : Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demonstrate the method in a program.
Determine the net power output of the engine : The cycle has a thermal efficiency of 35%, and steam changes from saturated vapor at 300 C during the heat addition process. If the mass flow rate of the steam is 2kg/s, determine the net power (kw) output of this engine.
Design a program that asks the user to enter 10 golf scores : design a program that asks the user to enter 10 golf scores. the scores should be stored in an Integer array. Sort the array in ascending order and display its contents).
Computing the time complexity using the big-o notation : You are required to calculate the time complexity using the big-O notation of the Algorithm_2 given by the following methods defined by the following Java code.
Display the total annual compensation : A salesperson will continue to earn a fixed salary of $50,000. The current sales target for every salesperson is $80,000.
Find the acceleration of the box as it slides up the ramp : A box starts from rest and is pushed a distance d = 1.25 meters along a frictionless ramp by a horizontal force, Fa, in 9.75 seconds. find the acceleration of the box as it slides up the ramp
Supply chain challenges in post-earthquake japan : Refer to the case study from Chapter 13 on "Supply chain challenges in post-earthquake Japan" in your textbook (p. 421) in Bozarth and Handfield (2013), Introduction to Operations and Supply Chain Management, 3rd Edition, Pearson Education, Prentice ..
How long was the heater on : A monatomic ideal gas is heated while at a constant volume of 1x10^-3 m^3, using a 10 watt heater. How long was the heater on
What is the maximum horsepower that the system can produce : A ssume that one half of the energy incident on the collector goes to this reservoir, which, in turn, serves as a source for a heat engine. If the temperature of the atmosphere is 70 F,

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd