| October 21, 2015

For this program you have to create two classes. The first class is the Salesperson class that has the following:


  • Fields (all private). These should be the only fields in the program


  1. name –name of the salesperson (example Jill Smith)


  1. decemberSales – sales in December (example 35.67)


  1. januarySales – sales in January


  1. baseSalary – The base salary (salary before the bonus, calculated in step #5)


  1. title – job title (example “Manager”)


  • Constructors


  1. Constructor with all fields as parameters


  1. You must check that the sales and salary are valid numbers (must be zero or a positive number).


  1. If a monthly sales figure is not valid, set it to 0.


  • If a salary is not valid, set it to $20,000.


  1. Constructor with only the name as a parameter


  1. Set the sales figures to 0 and the title to “Unknown”.


  1. Set the salary to $20,000


  1. Instead of writing $20,000 in the above constructors, use a named constant with an appropriate name


  • Get Methods – There should be a get method for each of the five fields.


  • Set Methods – There should be a set method for all fields except for name:


  1. setDecemberSales, setJanuarySales, setSalary


  1. Must check that the parameter being passed is a number as defined in step #2


  1. If it is not valid, leave the sales figure unchanged and print an appropriate error message.


  1. setTitle


  1. Allow the user to change the title


  • Other Methods


  1. totalSales


  1. Should calculate and return the total sales.


  1. bestMonth


  1. Should return the name of the month with the highest sales.


  1. If both months have the same sales, you may return the name of either month.


  1. totalEarned


  1. Should calculate and return the total amount earned by the salesperson, the base salary plus a bonus computed as described below.


  1. The bonus is dependent on the total sales and the title.


  • The calculations based on the total sales are:


  • If the total sales is under $40,000 the salesperson gets a bonus of 2% of total sales


  • For higher sales that are still under $60,000, the bonus is 3% of total sales


  • The bonus is 5% of total sales for all others


  1. The additional bonus based on title is:


  • An extra $2,500 for Managers



  1. printInfo


  1. This method should print out the following information:


  • Name


  • Title


  • December Sales


  • January Sales


  • Total Sales


  • Total Earned


  1. To calculate the last two you must use the corresponding methods. (You shouldn’t create fields for calculated values like total sales or total earned.)


  • Print out a line at the top of the printout (before the name)


  1. Include prompts with each piece of information printed.




The second class is a class that includes a main() method. This class should do the following (in the given order):


  • Create the first salesperson – (Lucy, 35000, 75000.65, 23000 base salary, Vice President)


  • Create the second salesperson (Tom, 12000, 3000, 10000 base salary, Manager)


  • Third salesperson


  1. Ask the user for the name of the salesperson (this should allow names with more than one word)


  1. Ask the user for the December sales of the salesperson


  1. Ask the user for the salesperson title


  1. Create the salesperson using the specified name


  1. Change the title to the title entered by the user


  1. Change the December sales to the number entered by the user


  1. Change the January sales to 23456.78


  • Use the printInfo method to print out the information for each salesperson.


  • Print out the name and title of the salesperson that has the highest sales in December. Print either name/title in case of ties.


  • Print out the name of the salesperson with the lowest total earned (print either name in the case of ties).


  • Print out the name of the month that the second salesperson’s sales were the highest.




Run your program twice using the following data for the third salesperson:


  • Julie Anne, 348.25, Project Leader


  • Chris, 99987.6, Manager






1) Each class must have a header, which has your name, the date, the program number and program title (name).


2) Your program should work correctly for any set of data, not only the given data.

Get a 5 % discount on an order above $ 150
Use the following coupon code :
Performance Management

Category: sample papers

Our Services:
Order a customized paper today!
Open chat
Hello, we are here to help with your assignments