Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

PART 1 Write a Java™ application using NetBeans™ Integrated

 
LogicPro's Avatar
  • Answered by:LogicPro
  • Computer Software Engineer
  • Positive Feedback: 99.4 %
  • Accepted Answers: 5551
Verified Expert
in Programming

Recent Feedback

Positive
fast response.
Positive
fast response
Positive
great
Positive
Thank you
Positive
Thank you
Positive
He responded quickly to my question with a solid answer.
Positive
Perfect as usual
Positive
thank you
Positive
thank you
Positive
Outstanding help!

Customer Question

PART 1
Write a Java™ application using NetBeans™ Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors:
A salesperson will earn a fixed salary of $30000
A salesperson will also receive a commission as a sales incentive. Commission is a percentage of the salesperson’s annual sales. The current commission is 5% of total sales.
• The total annual compensation is the fixed salary plus the commission earned.
The Java™ application should meet these technical requirements:
• The application should have at least one class, in addition to the application’s controlling class (a controlling class is where the main function resides).
• There should be proper documentation in the source code.
• The application should ask the user to enter annual sales, and it should display the total annual compensation.

PART 2
The company has recently changed its total annual compensation policy to improve sales.
• A salesperson will continue to earn a fixed salary of $30,000. The current sales target for every salesperson is $120,000
• The sales incentive will only start when 80% of the sales target is met. The current commission is 5% of total sales.
• If a salesperson exceeds the sales target, the commission will increase based on an acceleration factor. The acceleration factor is 1.25
• 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 total 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 Java™ application should also meet these technical requirements:
• The application should have at least one class, in addition to the application’s controlling class.
• The source code must demonstrate the use of conditional and looping structures.
• There should be proper documentation in the source code. 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 Java™ application should also meet these technical requirements:
• The application should have at least one class, in addition to the application’s controlling class.
• The source code must demonstrate the use of Array or ArrayList.
• There should be proper documentation in the source code.

PART 3
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 Java™ application should also meet these technical requirements:
• The application should have at least one class, in addition to the application’s controlling class.
• The source code must demonstrate the use of Array or ArrayList.
• There should be proper documentation in the source code.

 

Optional Information:
Language (or Software): Other
Browser (if necessary): Chrome

Already Tried:
I wrote the program but my code was wrong.

Submitted: 326 days and 10 hours ago.
Category: Programming
Value: $59
Status: CLOSED

Accepted Answer

Picture
Expert:  LogicPro replied326 days and 10 hours ago.


LogicPro :

Hi

LogicPro :

Welcome to JustAnswer

LogicPro :

You there?

JACUSTOMER-s4yzww0v- :

yes

LogicPro :

ok

JACUSTOMER-s4yzww0v- :

you there?

JACUSTOMER-s4yzww0v- :
LogicPro :

yes

LogicPro :

Please wait

LogicPro :

Working on it

LogicPro :

Please wait for few minutes

LogicPro :

You there?

LogicPro :

Here is part #1

LogicPro :

SalesPersonCommission2.zip

LogicPro :

Let me know once you get it

LogicPro :

Working on #2

JACUSTOMER-s4yzww0v- :

ok

LogicPro :

got it?

JACUSTOMER-s4yzww0v- :

How do I open this file?

LogicPro :

Unzip it to a folder

LogicPro :

You will get two java file

LogicPro :

Do you know how to unzip?

LogicPro :

got it?

LogicPro :

You there?

LogicPro :

Did you run it?

Customer : I could not open the file
LogicPro :

Download these two java files

LogicPro :
java

Driver1.java

LogicPro :
java

SalespersonCommission.java

LogicPro :

Let me know once you get them

LogicPro :

Did you run the file?

LogicPro :

Out them in same directory. Compile and run Driver1.java

LogicPro :

to get output

Customer :

I had to switch computers. Cannot open files.

LogicPro :

Did you download the files?

Customer :

Yes I tried to download the files but it did not work

LogicPro :

ok

LogicPro :

Please wait

LogicPro :

For part#1

LogicPro :

java

Driver1.java

LogicPro :
java

Driver1.java

LogicPro :
java

SalespersonCommission.java

LogicPro :

Download these two files and let me know

LogicPro :

once you get them

Customer :

Yes I have it? what is the last step, do I have to compile it? also all I need is part 3

Customer :

yes I was able to down load the files. This is part 1 now I need part 2 & 3

LogicPro :

ok

LogicPro :

You can compile and run it

LogicPro :

put them in same directory. Compile and run Driver1.java

Customer :

not to sound stupid, how do I put this in the same directory?

LogicPro :

copy them in a single folder

LogicPro :

like you put other files

LogicPro :

should I provide next part?

Customer :

yes

Customer :

How do I compile and run

LogicPro :

If you have java installed and path configured, use

LogicPro :

javac Driver1.java

LogicPro :

to compile

LogicPro :

and

LogicPro :

java Driver1

LogicPro :

to run

Customer :

Ok thanks, Im ready for part 2

LogicPro :

ok

LogicPro :

Please wait

LogicPro :
java

Driver.java

LogicPro :

SalespersonCommissionModified.java

LogicPro :

These are the files for #2

LogicPro :

Fot them

LogicPro :

*Got

LogicPro :

You there?

Customer :

Yes Got it, ready for part 3

LogicPro :

ok

LogicPro :
java

Driver.java

LogicPro :
java

SalespersonCommissionModified.java

LogicPro :

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant and fresh answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/computer/expert-logicpro/
so you can come back and ask me a question anytime.

Rate this answer as 'Excellent Service' and leave bonus or use the reply tab and let me know how I can be of further assistance

LogicPro :

Got it too?

Customer :

Can I submit the same scenario of part 1, part 2, part 3 using different percentages and comission amounts? the scenario is the same but with different percentages and comission amounts.

LogicPro :

I did them per the requirements

LogicPro :

It may become confusing

LogicPro :

if you use different amount and commission

Customer :

I will post the scenarios, give me a second so you can see.

LogicPro :

ok

Customer :

Part 1

Write a Java™ application using NetBeans™ Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors:

· A salesperson will earn a fixed salary of $30,000

· A salesperson will also receive a commission as a sales incentive. Commission is a percentage of the salesperson’s annual sales. The current commission is 8% of total sales.

· The total annual compensation is the fixed salary plus the commission earned.

The Java™ application should meet these technical requirements:

· The application should have at least one class, in addition to the application’s controlling class (a controlling class is where the main function resides).

· There should be proper documentation in the source code.

· The application should ask the user to enter annual sales, and it should display the total annual compensation.

Part 2

Modify the Week Two Java™ application using Java™ NetBeans™ IDE to meet these additional and changed business requirements:

· The company has recently changed its total annual compensation policy to improve sales.

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

· The sales incentive will only start when 80% of the sales target is met. The current commission is 8% of total sales.

· If a salesperson exceeds the sales target, the commission will increase based on an acceleration factor. The acceleration factor is 1.25

· 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 total 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 Java™ application should also meet these technical requirements:

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

· The source code must demonstrate the use of conditional and looping structures.

· There should be proper documentation in the source code.

Part 3

Modify the Week Three Java™ application using Java™ NetBeans™ IDE to meet these additional and changed business requirements:

· 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 Java™ application should also meet these technical requirements:

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

· The source code must demonstrate the use of Array or ArrayList.

· There should be proper documentation in the source code.

LogicPro :

All the parts are per these requirements

Customer :

I'm confused what does this mean? Can I change the numbers and how?

LogicPro :

I already said, it will confuse you as you will have to understand all three parts

LogicPro :

You can read all parts requirements and look at the code

LogicPro :

You can change any numbers you want then

Customer :

Thank's it's that simple, I got it now, just wanted to be sure.

LogicPro :

Great

LogicPro :

Rate this answer and ask me again for your next question :)

Customer :

OK, I will be in contact, thanks.

LogicPro :

welcome

Expert TypeComputer Software Engineer
Category: Programming
Pos. Feedback: 99.4 %
Accepts: 5551
Answered: 7/28/2012

Experience: Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

Ask this Expert a Question >
Customer replied322 days and 20 hours ago.

Hello LOGICPRO" need some help.

Picture
Expert:  LogicPro replied322 days and 20 hours ago.

yes, let me know.

Customer replied322 days and 20 hours ago.

This is Customer : I need help with previous codes that you wrote can you rewrite the codes in NetBeans

Customer replied322 days and 20 hours ago.

**LOGICPRO*cN YOU REWRITE CODES IN NETBEANS FOR ME ,This is Customer : I need help with previous codes that you wrote can you rewrite the codes in NetBeans

Customer replied322 days and 20 hours ago.

, **LOGICPRO*cN YOU REWRITE CODES IN NETBEANS FOR ME ,This is Customer : I need help with previous codes that you wrote can you rewrite the codes in NetBeans

Picture
Expert:  LogicPro replied322 days and 20 hours ago.

Which code you want me to write aagin?

Customer replied322 days and 19 hours ago.

CAN YOU PUT THIS IN NETBEANS.


import java.util.Scanner;





public class Wk4SalespersonCommissionModified

{

//fixed salary



private final int salary = 30000;

//sales

private double sales;

private String name; //added from other student's code

//constructor



public
Wk4SalespersonCommissionModified(double sales) {

this.sales = sales;

}

//get annual compensation



public double annualCompensation() {



return salary + commissionOnSales();

}



//methods to get salary and sales amount

public int getSalary() {

return salary;

}



public double getSales() {

return sales;

}



public double commissionOnSales() {

double incentive=0;

final double targetSales=120000;



if(sales>=targetSales)

{

incentive=sales*.05;

incentive = incentive * 1.1;

}

else if(sales>=(targetSales*.80) )

{

incentive = sales*.05;

}

else

incentive=0; //current
commission rate is 5%

return incentive;

}



public
Wk4SalespersonCommissionModified() {

}







//added in week 4 to prompt for name of sales person from other student's code



public String getName() {

return name;

}



public void setName(String name) {

this.name = name;

}

public void promptForName() {

String str = null;

Scanner scanner = new Scanner(System.in);

System.out.print("Please enter the name of Sales
Person: ");

str = scanner.nextLine();

setName(str);

}

import java.util.ArrayList;

import java.util.Scanner;





public class Driver {



public static void main(String[] args) {

/*

* Modify the Week Three Javaâ„¢
application using Java NetBeans IDE to meet these additional

and changed business requirements:

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.



*/



/*****************************Changed per merging with othr student's
********************/

Scanner input = new Scanner(System.in);

SalespersonCommissionModified sc1
= new SalespersonCommissionModified();

sc1.promptForName();

String name1 = sc1.getName();

/*****************************End change ********************/

/* The application should ask the user to enter annual sales, and it
should

display the total annual compensation.*/



System.out.print("Enter annual sales of first
salesperson: $");

double sales1 =
input.nextDouble();

/*****************************Changed per merging with othr student's
********************/

SalespersonCommissionModified sc2 = new SalespersonCommissionModified();

input = new
Scanner(System.in);

sc2.promptForName();

String name2 = sc2.getName();

/*****************************End change ********************/

/* The application should ask the user to enter annual sales, and it should

display the total annual compensation.*/

input = new
Scanner(System.in);

System.out.print("Enter annual sales of second
salesperson: $");

double sales2 =
input.nextDouble();





/*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.*/



double compensation=0,compensation1=0,compensation2=0;





//The source code must demonstrate the use of Array or ArrayList.



ArrayList al1 = new ArrayList();

al1.add("\nSalesperson: "+name1);

al1.add("Total Sales Total Compensation");

// do





int count=0;

for(int i=(int)sales1;i<=(sales1*1.5);i=i+5000)

{

sc1 = new SalespersonCommissionModified(i);


compensation=sc1.annualCompensation();

if(count==0)compensation1 = compensation;count++;

al1.add(sc1.getSales()+"\t"+compensation);



}

ArrayList al2 = new ArrayList();

al2.add("\nSalesperson: "+name2);

al2.add("Total Sales Total Compensation");

// do



count = 0;

for(int i=(int)sales2;i<=(sales2*1.5);i=i+5000)

{

sc2 = new SalespersonCommissionModified(i);


compensation=sc2.annualCompensation();

if(count==0)compensation2 = compensation;count++;

al2.add(sc2.getSales()+"\t"+compensation);



}



for(int i=0;i<al1.size();i++) {


System.out.println(al1.get(i));

}

for(int i=0;i<al2.size();i++) {


System.out.println(al2.get(i));

}



if(compensation1>compensation2)
{

System.out.println("Salesperson "+name2+"'s additional amount of sales that he must "

+" achieve to match or exceed the higher of the salesperson "+name1);

System.out.println("$"+(sales1-sales2));

}else if(compensation2>compensation1) {

System.out.println("Salesperson "+name1+"'s additional amount of sales that he must "

+" achieve to match or exceed the higher of the salesperson "+name2);

System.out.println("$"+(sales2-sales1));

}

else {

System.out.println("Both have same compensation");

}

}



}



Picture
Expert:  LogicPro replied322 days and 13 hours ago.

Apologies. I was offline

upload the file to http://wikisend.com and post download link here. Formatting is messed up.

 
Tweet

7 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
Submit pseudocode and a flowchart for the following programming 6/10/2013
I would like to give a directory and then report on the extensions 6/9/2013
Can you help me with a programming assignment? 6/9/2013
I'm looking for someone to tutor me, for programming, and softwar 6/3/2013
hi there'i have four questions about java its all about 5/29/2013
For The Doctor ONLY - Please fix the Doe Valley town Meeting 5/18/2013
Scenario: 5/17/2013
I need help with my website, I put in the Infolink ad code 5/17/2013
I need to make the submit button bigger 5/15/2013
Need a java programming to fulfill the following requirements: 1. 5/13/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
191 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan