# i need a help as fast as possible

• 01-22-2014, 07:03 AM
whatever
i need a help as fast as possible
Hi Guys,
Can you please help me. I have to write a project to calculate 10 employees sales then give them all a bonus of 15% then get the highest one and give him a bonus of 5%.
But I'm having difficulties . PLEASE SOMEONE HELP

My Code that I wrote so far (I know it's wrong):

package project005;
import java.util.Scanner;

/**
*
* @author whatever
*/

public class Project005 {
private static int i;

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

//we wrote the employees names in a string array//

System.out.println("The Employees No., Sales, Bonus, and Extra Bonus for the Highest Employee");

String[] employees = new String[10];
employees[0] = "1";
employees[1] = "2";
employees[2] = "3";
employees[3] = "4";
employees[4] = "5";
employees[5] = "6";
employees[6] = "7";
employees[7] = "8";
employees[8] = "9";
employees[9] = "10";

int[] sales = {500, 1000, 1200, 700, 800, 1300, 860, 900, 1250, 1010};

double Bonus;
Bonus = 0.15;
System.out.println(Bonus * sales[i]);

double ExtraBonus;
ExtraBonus = 0.05;

int[] ExtraBonus = new int[10];
int highest = ExtraBonus[10];
for (int i = 0; i < sales.length; i++){
if (ExtraBonus[i] > highest)
highest = ExtraBonus[i];

System.out.println();

System.out.println(employees[i] + "," + sales[i] + Bonus + "," + highest + "," + ExtraBonus);
}
}}
• 01-22-2014, 10:14 AM
SurfMan
Re: i need a help as fast as possible
I would like to help, but I don't see your question anywhere...
• 01-22-2014, 10:18 AM
whatever
Re: i need a help as fast as possible
this is the question

Develop a Java program that calculate weekly sales bonuses for salespersons at a company, store those values, and finds the employee with the highest sales and applies an extra bonus:
1. Reads in 10 sales amounts from the user representing the weekly sales of different employees and store the values in an array. Employees will be identified by their numbered position that are entered into the array (i.e. 1st employee, 2nd employee, … ,10th employee).
The 10 sales amounts to be used for input are: 500, 1000, 1200, 700, 800, 1300, 860, 900, 1250, 1010
2. For each value stored in the array above, create an element in a second array that stores the bonus calculation based on the formula:

Bonus = 15% of their respective sales.

3. Identify the highest employee sales amount and apply an extra bonus of 5% of the total sales for that employee.
4. Output (Display) all the values in both arrays in the form: employee number (their position in the array as noted above, sales amount, bonus, and total weekly salary (don't worry about formatting, but apply commas between items).
For example:
Employee #, weekly sales, weekly bonus, weekly salary
1, 120.0, 12.0, 132.0
2, 140.0, 14.0, 154.0
3, 150.0, 15.0, 165.0

5. Lastly output the employee number with the highest sales and apply the extra bonus as indicated above and print their total salary based on their sales, initial bonus and extra bonus.
• 01-22-2014, 10:34 AM
SurfMan
Re: i need a help as fast as possible
No. That is the *assignment*. A question would be: "When I run this code, I get a NullPointerException on line 45, but I don't know why. Here's the stacktrace and the error message. Does anybody know why this happens?"

Oh, and PS: wrap your code in a [code][/code] block so we get the goodies as syntax highlighting etc. And make sure it's properly indented, because I got more things to do than trying to unravel spagetti code.
• 01-22-2014, 10:50 AM
gimbal2
Re: i need a help as fast as possible
If I do that assignment, where do I send the code to get the credit for it?
• 01-22-2014, 02:55 PM
Daryn
Re: i need a help as fast as possible
Quote:

Originally Posted by gimbal2
If I do that assignment, where do I send the code to get the credit for it?

What are you talking about sending the code. and what is wrong with your code now. What is it doing. Is it compiling. Is it adding the wrong bonus, will it not find the highest one. What is it? If you want fast help you have to try to as specific as possible
• 01-22-2014, 03:16 PM
SurfMan
Re: i need a help as fast as possible
Quote:

Originally Posted by Daryn
What are you talking about sending the code. and what is wrong with your code now. What is it doing. Is it compiling. Is it adding the wrong bonus, will it not find the highest one. What is it? If you want fast help you have to try to as specific as possible

Gimbal2 is not the OP, Mr. "Whatever" is. Gimbal2 is just taking a stab at the posting of the assignment.
• 01-22-2014, 03:51 PM
Daryn
Re: i need a help as fast as possible
Quote:

Originally Posted by SurfMan
Gimbal2 is not the OP, Mr. "Whatever" is. Gimbal2 is just taking a stab at the posting of the assignment.

Lol oh well thats embarissing. Sorry I was in a hurry leaving for school and the title made it sound important so I got on to help and clearly didn't pay attantion. But okay @whatever what is your code doing wrong. Is it not adding the highest bonus. Is it not compileing. What wrong?
• 01-22-2014, 04:31 PM
gimbal2
Re: i need a help as fast as possible
Ha ha ha :) Now imagine this situation: someone asks a question. You reply. Then you get a reply that would make you think that it is the original poster... but it is not.

That happens to me at least half a dozen times a year where someone else just seamlessly "takes over" and you can only spot it by looking at the user name.
• 01-23-2014, 01:30 AM
Daryn
Re: i need a help as fast as possible
You know being he wants help fast you think he would be active in here
• 01-26-2014, 06:22 PM
QueenAlia
Re: i need a help as fast as possible
About your assignment i have a clue where you got it from as i am working on it myself. For your coding i believe it is all good but the parts where you wrote :

"System.out.println(Bonus * sales[i]);" and " int[] ExtraBonus = new int[10];" are wrong and won't work if you type it down in netbeans ( that is if it is the program you are using).

I suggest that the first step you take before you start coding is write down on paper a simple algorithm on how you think the solution would be.

Second thing you need to do is to figure out it's type is it a loop, an array, boolean or what?.

After that look through your course notes or so on i'm pretty much sure whomever your professor is... he/she probably have given you something similar.

* Just try to copy what ever you think fits and try it out until it works.

If i am done with mine i'll try to post the answers here if not oh well...
• 01-26-2014, 10:48 PM
SurfMan
Re: i need a help as fast as possible
Quote:

Originally Posted by QueenAlia
If i am done with mine i'll try to post the answers here if not oh well...

May be you shouldn't. Here are the reasons why you shouldn't post the solution here:
1) He needed this as fast as possible. He's probably too late by now and flunked the test.
2) He couldn't be arsed to repsond to any reaction.
3) He *will* copy your stuff and hand it in as his own. He will never have studied and learned a thing. You just spoonfed his cheating ways.

In the end his diploma, if any, will imply certain knowledge levels. If you spoonfeed the solutions, his diploma means jack squat and only hurts his future collegues who get to clean up his shit.
• 01-28-2014, 12:13 PM
QueenAlia
Re: i need a help as fast as possible
Quote:

Originally Posted by SurfMan
May be you shouldn't. Here are the reasons why you shouldn't post the solution here:
1) He needed this as fast as possible. He's probably too late by now and flunked the test.
2) He couldn't be arsed to repsond to any reaction.
3) He *will* copy your stuff and hand it in as his own. He will never have studied and learned a thing. You just spoonfed his cheating ways.

In the end his diploma, if any, will imply certain knowledge levels. If you spoonfeed the solutions, his diploma means jack squat and only hurts his future collegues who get to clean up his shit.

okay if you say so :D
thanx for telling me :3