473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dealing with super Classes--Need Help!!

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
0 1208

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

Similar topics

0
by: Gonçalo Rodrigues | last post by:
Hi, I have a problem with threads and sockets. I'll try to describe the problem in words with pseudo-code. I've been working on a few classes to make it easier to work with threads. This...
6
by: Steven Bethard | last post by:
When would you call super with only one argument? The only examples I can find of doing this are in the test suite for super. Playing around with it: py> class A(object): .... x = 'a'...
2
by: Michael P. Soulier | last post by:
Ok, this works in Python on Windows, but here on Linux, with Python 2.4.1, I'm getting an error. The docs say: A typical use for calling a cooperative superclass method is: class C(B):...
7
by: Kent Johnson | last post by:
Are there any best practice guidelines for when to use super(Class, self).__init__() vs Base.__init__(self) to call a base class __init__()? The super() method only works correctly in multiple...
7
by: Pupeno | last post by:
Hello, I have a class called MyConfig, it is based on Python's ConfigParser.ConfigParser. It implements add_section(self, section), which is also implemented on ConfigParser.ConfigParser, which I...
4
by: ddtl | last post by:
Hello everybody. Consider the following code: class A(object): def met(self): print 'A.met' class B(A): def met(self):
1
by: eshortt84 | last post by:
hey, i'm new to java and i keep getting the return type required error on this line; public dvds(int productNum, String name, int units, double price, String rating) { The code for the whole...
2
by: Millie88 | last post by:
I am getting an error on the random.js var size and no tip is showing. Any help is appreciated! <html> <head> <!-- The Home Center Filename: home.htm
0
by: atencorps | last post by:
Hello I have the following code but need some help on it. The idea of the code is the main sections ie Service Management are viewable when the page is loaded and by clicking on the main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.