Any Java Guru?
sanuG · Jan 21, 2014 2:43 PM · 23,392 views
public class SanuG { public static void main (String args[]) { System.out.println("Search the newBoston on YouTube"); } }//end of program
kris056 · Jan 21, 2014 8:58 PM
What do need?
fuckeetow · Jan 21, 2014 10:32 PM
What do you need?
fuckeetow · Jan 21, 2014 10:40 PM
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....
sanuG · Jan 22, 2014 8:24 AM
Why don't you share your problem with all so that everyone can pitch in and have more experience ??
DEVN · Jan 22, 2014 1:38 PM
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.
fuckeetow · Jan 22, 2014 7:03 PM
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.
sanuG · Jan 23, 2014 8:44 AM
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 TARGET_SALES; } /** * @param sales * @return */ private static boolean targetMet(Double sales) { return sales >= 80 * TARGET_SALES / 100; } }
prankster · Jan 23, 2014 3:17 PM
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 · Jan 23, 2014 3:18 PM
Dont know what "acceleration factor" is though :P
prankster · Jan 23, 2014 3:19 PM
Prankster you are da man, thanks a lot - there may be more to follow if that is okay with you!
sanuG · Jan 24, 2014 9:04 AM
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.
prankster · Jan 24, 2014 9:43 AM
Yes definitely will try to do it myself, but was stuck on few stuff and had lot of errors. Thanks again!
sanuG · Jan 24, 2014 10:04 AM
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
sanuG · Jan 30, 2014 2:15 PM
https://www.likeplum.com/discu...
prankster · Jan 30, 2014 2:25 PM
Thanks
sanuG · Jan 30, 2014 2:36 PM
This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.
Start a New Discussion