Results 1 to 7 of 7
  1. #1
    Hamodi18 Guest

    Smile please delete this thread

    Hello everyone ,,..
    im new in this forum ..

    can u tell me how to delete all this thread?
    Last edited by Hamodi18; 07-07-2010 at 10:13 PM. Reason: i WANT DELETE THIS THREAD

  2. #2
    OOP24H is offline Member
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Default

    I think it is too easy.You should do it yourself before needing someone's help.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default

    Is there a question about java programming here?

  4. #4
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by Norm View Post
    Is there a question about java programming here?

    i guess Hamodi18 doesn't know where and how to begin. so I wrote the superclass and the worker class as starters for you and i hope you can implement all the other requirements. so, you should be able to post a concrete question about java next time.


    Java Code:
    public abstract class Worker {
    
    	// here are the instance variables, not visible outside the class
    	private String Id;
    	private String name;
    	private String dep;
    	
    	// the constructor that initialize your instance variables
    	public Worker(String Id, String name, String dep) {
    		this.Id = Id;
    		this.name = name;
    		this.dep = dep;
    	}
    	
    	// the abstract method
    	abstract double CalculateSalary();
    
    	public String getId() {
    		return Id;
    	}
    
    	// all getters and setters
    	public void setId(String id) {
    		Id = id;
    	}
    
    	public String getName() {
    		return name;
    	}
    
    	public void setName(String name) {
    		this.name = name;
    	}
    
    	public String getDep() {
    		return dep;
    	}
    
    	public void setDep(String dep) {
    		this.dep = dep;
    	}
    }

    Java Code:
    public class Hourly extends Worker {
    	int hoursWorked;
    	double hourlyRate;
    	
    	// first constructor
    	public Hourly(String Id, String name, String dep) {
    		super(Id, name, dep);
    	}
    	
    	// second constructor with hours worked and hourly rate
    	public Hourly(String Id, String name, String dep, int hoursWorked, double hourlyRate) {
    		super(Id, name, dep);
    		// set hoursWorked and hourlyRate
    		setHoursWorked(hoursWorked);
    		setHourlyRate(hourlyRate);
    	}
    	
    	public int getHoursWorked() {
    		return hoursWorked;
    	}
    
    	public void setHoursWorked(int hoursWorked) {
    		this.hoursWorked = hoursWorked;
    	}
    
    	public double getHourlyRate() {
    		return hourlyRate;
    	}
    
    	public void setHourlyRate(double hourlyRate) {
    		this.hourlyRate = hourlyRate;
    	}
    
    	// the class Hourly must implement the abstract method 
    	public double CalculateSalary() {
    		return hoursWorked * hourlyRate;
    	}
    }

    hope, this is not too much help.

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default

    I don't understand how giving someone a fish teaches him how to fish.

  6. #6
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Nor do I.

    @OP: Read this: Starting Writing a Program
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  7. #7
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    Quote Originally Posted by PhHein View Post
    Nor do I.

    @OP: Read this: Starting Writing a Program
    That link should be a Sticky in here, its as fundamental and perhaps more important that any Hello World program

Similar Threads

  1. Custom professional objects/package
    By Dimebag in forum New To Java
    Replies: 1
    Last Post: 05-31-2010, 06:09 PM
  2. J2EE, PHP, Linux, MySql, CSS, HTML Development Professional
    By softdev in forum Reviews / Advertising
    Replies: 1
    Last Post: 01-17-2008, 11:52 AM
  3. Onsite UK for Java/J2EE Professional
    By aman_max1981 in forum Reviews / Advertising
    Replies: 0
    Last Post: 11-23-2007, 11:02 AM
  4. SDE for Eclipse Professional Edition 4.1 sp1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-16-2007, 06:47 PM
  5. SDE for Eclipse Professional Edition 4.0 SP2
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-22-2007, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •