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

  Is imageholder and picturebox are similar controls

ImageHolder and PictureBox are similar controls. Do you agree? Why or why not?

  Show layout of specified cache for cpu address memory

Show the layout of the specified cache for a CPU that can address 8M x 16 of memory. Give the layout of the bits per location and the total number of locations.

  Keyboard combinations that can increase

Microsoft® Word provides keyboard combinations that can increase a user's efficiency. How can these shortcuts simplify the support process for Microsoft® Word

  Evaluate following integrals using simpson rule

Evaluate following integrals using simpson's rule and corrected simpson's rule (or richardson extrapolation in case the corrected simpson's is not applicable). In each case, use n = 2,4,8,16,32.

  Which data input appears on output y

View a datasheet function table for a 74151 device. Using Quartus pin names, assume the chip is enabled and C = 1, B = 0, and A = 0. Which data input appears on output Y?

  Which value border-collapse will give each cell of a table

Which value of border-collapse will give each cell of a table a border that can be specified independently of adjacent cells

  Explaining reasonable values for items in risk register

Suggest reasonable values for the items in the risk register for this asset and threat, and provide justifications for your choices.

  Write an xeyes command to display a window

Find and install xeyes (not tuxeyes). Write an xeyes command to display a window that is 600 pixels wide and 400 pixels tall, is located 200 pixels from the right edge of the screen and 300 pixels from the top of the screen.

  What is the asymptotic time complexity of algorithm

Suppose an algorithm has two parts. The first part involves sorting and takes (10 nlog n) steps, where n is the input size. What is the asymptotic time complexity of the overall algorithm, in Big Theta notation?

  Data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs, Flash RAM, and solid-state drives

  How do you create a 3d array of doubles in c++

How do you create a 3D array of doubles in C++

  Kind of information monitor check to see if it sanitize

Which kind of information should the monitor check to see if it must sanitize the data to conceal the names of the users and the names and addresses of the computers involved?

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