By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,779 Members | 1,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,779 IT Pros & Developers. It's quick & easy.

Dealing with super Classes--Need Help!!

P: 14
Need to write a class called Sales that is extends from a super class called Employee.

I feel like I am going in the wrong direction. look at this:
Here are the specs:

static double field values - BEST_COMMISSION, HIGH_COMMISSION, HIGH_SALES, LOW_COMMISSION,LOW_SALES, QUOTA_COMMISION, QUOTA_SALES.

I believe I have the main constructor correct?

Method - getCommissionRate( )
Calculates the commision based on the amount of net sales for that pay period.
If the employee is not paid, return 0
If the net sales are less than the LOW sales quota ($25,000), return .05 (5%)
If the net sales are less than the MIDDLE sale quota ($50,000), return .06 (6%)
If the net sales are less than the HIGH sale quota ($100,000), return .07 (7%)
If the net sales are above the HIGH sale quota ($100,000), return .10 (10%)


Method - getNetSales ( )
Returns the net sales that the employee sold
Method - getPay() from the employee class
Returns . the pay if any for the Sales employee calculated as the net sales multipied by the commission rate.
Method - setNetSales ( )
sets the net Sales amount.

Methods inherited from the class that is done called Employee:
getAddress, getCity, getCityState, getEmployeeId, getFirstname, getFullName, getHireDate, getLastName, getProgrammer, getState, getTermDate, getZip, isPaid, setAddress, setEmployeeID, setFirstName, setHireDate, setLastName, setTermDate, setZip, toString.

I can write these but not sure about the correct set up for the results.

public static final double LOW_SALES
public static final double QUOTA_SALES
public static final double HIGH_SALES
public static final double LOW_COMMISSION
public static final double QUOTA_COMMISSION
public static final double HIGH_COMMISSION
public static final double BEST_COMMISSION

public static final double BEST_COMMISSION 0.1
public static final double HIGH_COMMISSION 0.07
public static final double HIGH_SALES 100000.0
public static final double LOW_COMMISSION 0.05
public static final double LOW_SALES 25000.0
public static final double QUOTA_COMMISSION 0.06
public static final double QUOTA_SALES 50000.0


hope this is enough info. Maybe too much I have a tendancy to over do things.
thanks for your help.



Beginning of Code

import java.util.*;
public class Sales
extends Employee {
public Sales(int empID, String lastName, String firstName,
GregorianCalendar hireDate, String address, int zip) {
super(empID, lastName, firstName, hireDate, address, zip);
}

public Sales(int empID, String lastName, String firstName,
GregorianCalendar hireDate, String address, int zip,
GregorianCalendar termDate) {
super(empID, lastName, firstName, hireDate, address, zip, termDate);
}
//Constructor --
//Use the Employee constructor class to set the
//empID, lastName, firstName, hireDate, address
//and zip code Set the netSales for the Sales employee

//Method Summary
public double getCommisionRate(){
return getCommisionRate();
}//Calculates commission based on amount of net sales that were made
//in this pay period
public double getNetSales(){
return getNetSales();
}//returns the net sales that the employee sold
public void setNetSales(double netSales){;
}
public double getPay() {
return 0.0;
}//method getPay - should be a double
}
endCode

thanks to everyone

John.
Nov 19 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.