Employee - R. L. Hendrix CSC 119 -01 February 16, 2011...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
R. L. Hendrix CSC 119 -01 February 16, 2011 Program #2 Algorithm used to solve: I used Inheritance to do this program as well as get and set methods and override. Data used to test: public class Employee { protected String name; protected String ID; protected int age; protected double salary; protected String title; protected String deptname; public Employee( String myname, String myID, int myage, double mysalary, String mytitle, String mydeptname ) { name = myname; ID = myID; age = myage; salary = mysalary; title = mytitle; deptname = mydeptname; } public void setName( String myname ) { name = myname; } public String getName() { return name; } public void setID( String myID ) { ID = myID; } public String getID() { return ID; } public void setMyage( int myage ) {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
age = myage; } public int getAge() { return age; } public void setTitle( String mytitle ) { title = mytitle; } public String getTitle() { return title; } public void setDeptname( String mydeptname ) { deptname = mydeptname; } public String getDeptname() { return deptname; } public void setSalary( int mysalary, double bonus ) { salary = salary + (salary * 0.05 );
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/15/2011 for the course CS 119 taught by Professor Jackson during the Fall '10 term at Jackson State.

Page1 / 5

Employee - R. L. Hendrix CSC 119 -01 February 16, 2011...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online