473,699 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dealing with super Classes--Need Help!!

14 New Member
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 - getCommissionRa te( )
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_COMMISSIO N
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_COMMISSIO N 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,
GregorianCalend ar hireDate, String address, int zip) {
super(empID, lastName, firstName, hireDate, address, zip);
}

public Sales(int empID, String lastName, String firstName,
GregorianCalend ar hireDate, String address, int zip,
GregorianCalend ar 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 getCommisionRat e(){
return getCommisionRat e();
}//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(dou ble netSales){;
}
public double getPay() {
return 0.0;
}//method getPay - should be a double
}
endCode

thanks to everyone

John.
Nov 19 '06 #1
0 1220

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

Similar topics

0
1445
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 framework, let us call it that, consists in two parts. The first part is just a basic thread class deriving from threading.Thread with a few extra functionality that makes it easier for a thread to spawn a new thread and "father it". Each of its
6
2006
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' .... py> class B(A): .... x = 'b' ....
2
2544
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): def meth(self, arg): super(C, self).meth(arg)
7
5251
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 inheritance when the base classes are written to expect it, so "Always use super()" seems like bad advice. OTOH sometimes you need super() to get correct behaviour. ISTM "Only use super() when you know you need it" might be
7
1926
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 want to call. So, reducing the problem to the bare minimum, the class (with a useless add_section that shows the problem): .... def add_section(self, section): .... super(MyConfig, self).add_section(section)
4
1718
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
5433
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 class is as follows; // extended class public class dvd extends dvds {
2
3229
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
1964
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 titles/headings or clicking on the 'expand all' will allow you to view the items underneath each title/heading. The page seems to be broken at the Incident and Request Management title/heading section as shown in the image attached. Can anyone help /...
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7745
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.