[Show all top banners]

SanuG
Replies to this thread:

More by SanuG
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 Java
[VIEWED 4634 TIMES]
SAVE! for ease of future access.
Posted on 01-21-14 2:43 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

Any Java Guru?
 
Posted on 01-21-14 8:58 PM     [Snapshot: 112]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

public class SanuG
{
public static void main (String args[])
{
System.out.println("Search the newBoston on YouTube");
}
}//end of program

 
Posted on 01-21-14 10:32 PM     [Snapshot: 163]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 
 
Posted on 01-21-14 10:40 PM     [Snapshot: 170]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

What do you need?
 
Posted on 01-22-14 8:24 AM     [Snapshot: 251]     Reply [Subscribe]
Login in to Rate this Post:     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....
 
Posted on 01-22-14 1:38 PM     [Snapshot: 326]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

Why don't you share your problem with all so that everyone can pitch in and have more experience ??
 
Posted on 01-22-14 7:03 PM     [Snapshot: 368]     Reply [Subscribe]
Login in to Rate this Post:     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.
 
Posted on 01-23-14 8:44 AM     [Snapshot: 449]     Reply [Subscribe]
Login in to Rate this Post:     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.

 
Posted on 01-23-14 3:17 PM     [Snapshot: 506]     Reply [Subscribe]
Login in to Rate this Post:     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;
}
}

 
Posted on 01-23-14 3:18 PM     [Snapshot: 508]     Reply [Subscribe]
Login in to Rate this Post:     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
 
Posted on 01-23-14 3:19 PM     [Snapshot: 509]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

Dont know what "acceleration factor" is though :P
 
Posted on 01-24-14 9:04 AM     [Snapshot: 608]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

Prankster you are da man, thanks a lot - there may be more to follow if that is okay with you!
 
Posted on 01-24-14 9:43 AM     [Snapshot: 620]     Reply [Subscribe]
Login in to Rate this Post:     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.
 
Posted on 01-24-14 10:04 AM     [Snapshot: 628]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

Yes definitely will try to do it myself, but was stuck on few stuff and had lot of errors. Thanks again!
 
Posted on 01-30-14 2:15 PM     [Snapshot: 758]     Reply [Subscribe]
Login in to Rate this Post:     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
 
Posted on 01-30-14 2:25 PM     [Snapshot: 769]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 

https://www.likeplum.com/discuss/view/pid/4625/aid/8812
 
Posted on 01-30-14 2:36 PM     [Snapshot: 774]     Reply [Subscribe]
Login in to Rate this Post:     0       ?        
 
 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 7 days
Recommended Popular Threads Controvertial Threads
TRUMP 2016!!! Here is why?
US upcoming recession --- is it good time to buy house when rates are low or is it good time to wait recession?
travel from nepal to US amid corona virus
TPS TO GC TO AOS INTERVIEW
Pete Buttigieg is the new Hillary Clinton
Send money in Nepal
American Idol मा पहिलोपटक नेपाली केटाेकाे यस्तो दम्दार प्रस्तुति | Dibesh Pokharel | Arthur Gunn
Wow ... सोनिकालाइ हिराको हार र चुम्बन
Best Java Training
Democrat’s presidential nominee should have Mitt Romney as VP
TRUMP 2016!!! Here is why?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters