Java - Sajha Mobile
SAJHA MOBILE
Java
Posts 17 · Viewed 10499 · Go to Last Post
SanuG
· Snapshot 0
Like · Likedby · 0
Any Java Guru?
kris056
· Snapshot 112
Like · Liked by · 0
public class SanuG
{
public static void main (String args[])
{
System.out.println("Search the newBoston on YouTube");
}
}//end of program
fuckeetow
· Snapshot 163
Like · Liked by · 0
What do need?
fuckeetow
· Snapshot 170
Like · Liked by · 0
What do you need?
SanuG
· Snapshot 251
Like · Liked by · 0
Need a little help with this little project that I am doing. I have emailed you through Sajha email hope to hear from you F*keetow....
DEVN
· Snapshot 326
Like · Liked by · 0
Why don't you share your problem with all so that everyone can pitch in and have more experience ??
fuckeetow
· Snapshot 368
Like · Liked by · 0
I am with DEVN. Not like I don't want to help. But, had you shared your actual problem in the in the first post, by now you wouldn't gotten enough suggestion to solve it.
SanuG
· Snapshot 449
Like · Liked by · 0
ok here you go.. first part was this which worked just fine but I have to do the second part to include on this first part...Thanks in advance for all your help!

/*
* Title: Simple Commission Calculation Part I
* This project demostrates:
* - The use of an additional Method
* - The ability to enter data
* - Documentation in Source Code
*
* Author: Sanjay Rimal
* Date: 1/20/2014
*/

package Sanjay;

import static java.lang.System.in;
import java.util.Scanner;

/*
* Added java.util.Scanner for the input of data from user keyboard
*/
public class CommissionCalculation1
{

/**
* @param args the command line arguments
* Salesperson monthly salary of $4,000.00 = The Annual salary is $48,000.00
* Salesperson total annual salary = Annual salary + annual sales * 20%
* commission
*/
public static void main(String[] args)
{
// TODO code application logic here
Scanner input = new Scanner ( System.in );
System.out.println("Please enter annual sales: $");
Double sales = input.nextDouble();
System.out.println("For annual sales of $" + sales + " and a yearly salary " + " of $48,000, total annual compensation is $" + calcCompensation(sales));

}

public static double calcCompensation(Double sales)
{

double compensation = 48000 + (0.20 * sales);
compensation = (double) (Math.round(compensation*100))/100;
System.out.println();
return compensation;

//To change body of generated methods, choose Tools | Templates.
}//end of method main

}//end class CommissionCalclator1


Second!!!!
Modify the 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 monthly salary of $4,000.00. The current sales target for every salesperson is $120,000.00.

• The sales incentive will only start when 80% of the sales target is met. The current commission is 25% 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 method, in addition to the application’s starting method (“main” method).
• The source code must demonstrate the use of conditional and looping structures.
• There should be proper documentation in the source code.
prankster
· Snapshot 506
Like · Liked by · 0
package test;

import java.util.Scanner;

/**
* @author Sanjay Rimal
*
*/
public class CommisionCalculation1
{
private static final Double TARGET_SALES = 120000.00;

public static void main(String[] args)
{
Scanner input = new Scanner ( System.in );
System.out.println("Please enter annual sales: $");
Double sales = input.nextDouble();

System.out.println("For annual sales of $" + sales + " and a yearly salary " + " of $48,000, total annual compensation is $" + calcCompensation(sales));

System.out.println("Compensation you could have earned");
double fiftyPercentAboveAnnualSales = 50 * sales/100 + sales;

System.out.println("Total sales | Total compensation");
while (sales <= fiftyPercentAboveAnnualSales )
{
System.out.println(sales + " | " + calcCompensation(sales));
sales = sales + 5000;
}
input.close();
}

private static double calcCompensation(Double sales)
{
double commissionFromSales = 0.0;
if (targetMet(sales))
{
commissionFromSales = 25 * sales/100;
}

if (targetExceeded(sales))
{
commissionFromSales *= 1.25;
}
return commissionFromSales;
}

/**
* @param sales
* @return
*/
private static boolean targetExceeded(Double sales)
{
return sales > TARGET_SALES;
}

/**
* @param sales
* @return
*/
private static boolean targetMet(Double sales)
{
return sales >= 80 * TARGET_SALES / 100;
}
}
prankster
· Snapshot 508
Like · Liked by · 0
output :
Please enter annual sales: $
115000
For annual sales of $115000.0 and a yearly salary of $48,000, total annual compensation is $28750.0
Compensation you could have earned
Total sales | Total compensation
115000.0 | 28750.0
120000.0 | 30000.0
125000.0 | 39062.5
130000.0 | 40625.0
135000.0 | 42187.5
140000.0 | 43750.0
145000.0 | 45312.5
150000.0 | 46875.0
155000.0 | 48437.5
160000.0 | 50000.0
165000.0 | 51562.5
170000.0 | 53125.0
prankster
· Snapshot 509
Like · Liked by · 0
Dont know what "acceleration factor" is though :P
SanuG
· Snapshot 608
Like · Liked by · 0
Prankster you are da man, thanks a lot - there may be more to follow if that is okay with you!
prankster
· Snapshot 620
Like · Liked by · 0
Are you a CS student? If yes, you should try to understand what I did there... and try to do it on your own, I am okay with helping you if you get stuck anywhere.
SanuG
· Snapshot 628
Like · Liked by · 0
Yes definitely will try to do it myself, but was stuck on few stuff and had lot of errors. Thanks again!
SanuG
· Snapshot 758
Like · Liked by · 0
Prankser ji sorry to bother you one more time...I tried but was lost and can't seem to grasp where to start - continuous to the previous one I need to add:

Enter name for salesperson 1: Henry
Enter total sales for Henry: 100000
Enter name for salesperson 2: John
Enter total sales for John: 120000
Enter name for salesperson 3: Michael
Enter total sales for Michael: 160000
.........
Michael made the most sales, totaling: $160,000.00
Michael's total compensation for the year were: $XXXX.XX

John's total compensation for the year were: $XXX.XX

John needs to make an additional $40,00.00 of sales to meet Michael's sales.

Henry's total compensation for the year were: $XXX.XX

Henry needs to make an additional $60,000.00 of sales to meet Michael's sales.

I really appreciate your help Sir!

Sanjay
prankster
· Snapshot 769
Like · Liked by · 0
https://www.likeplum.com/discuss/view/pid/4625/aid/8812
SanuG
· Snapshot 774
Like · Liked by · 0
Thanks
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 9 · Viewed 12587 · Likes 1
· Posts 7 · Viewed 4005 · Likes 1
· Posts 1 · Viewed 1094
· Posts 1 · Viewed 1080
· Posts 1 · Viewed 989
· Posts 1 · Viewed 1080
· Posts 1 · Viewed 1050
· Posts 21 · Viewed 10040 · Likes 1
· Posts 3 · Viewed 2608
· Posts 5 · Viewed 7799 · Likes 1



Your Banner Here
Travel Partners
Travel House Nepal