Question
Asked by:
bclimb1983
bclimb1983
Rating : No Rating
Questions Asked: 6
Tutorials Posted: 0
 

$15.00 2 Java Programs

Q:
I need the complete code for the following assingment. The code must be as simple as possible but still cover the entire question, as well as contain comments for explanation of code. I need this code by 12:00pm CST, May 6th, 2008.

Program 1: Shifts

Design a class named Employee. The class should keep the following information fields:
1. Employee name
2. Employee number in the format XXX-L, where each X is a digit within the range of 0-9 and the L is aletter within the range of A-M.
3. Hire date

Write one or more constructors and the appropriate accessor and mutator methods for the class. Next, write a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following information:
1. Shift (an integer)
2. Hourly pay rate (a double)

The workday is divided into 2 shifts, day and night. The shift field will be an integer value representing the shift that the employee works. The day is shift 1 and the night shift is shift 2. Write one or more constructors and the appropriate accessor and mutator methods for the class. Demonstrate the classes by writing a program called Shifts that uses the ProductionWorker object.


Program 2: Leader

Design a TeamLeader class that extends the ProductionWorker class. The TeamLeader class should have fields for the monthly bonus amount, the required number of training hours, and the number of training hours that the team leader has attended. Write one or more constructors and the appropriate accessor and mutator methods for the class. Demonstrate the use of the TeamLeader object in a program called Leader.
 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
cxxliu
cxxliu
Rating (5): A
Questions Asked: 0
Tutorials Posted: 31, earned $100.78
 

$15.00 Answered, nicely documented, 5 Java files

  • This tutorial was purchased 2 times and rated A- by students like you.
  • Posted on May. 06, 2008 at 03:08:52AM
A:
Preview: ... // invoke the superclass constructor<br> super(name, id, hireDate);<br> // default values<br> monthlyBonus = 0.0;<br> requiredTrainingHours = 0;<br> trainingHoursAttended = 0;<br> }<br><br> // get monthly bonus amount<br> public double getMonthlyBonus() {<br> return monthlyBonus;<br> } ...

The full tutorial is about 113 words long plus attachments.

Attachments:
2JavaPrograms.zip (2K)
Posted by:
sudipta
sudipta
Rating (2461): A
Questions Asked: 0
Tutorials Posted: 15317, earned $72,290.21
 

$20.00 Full Java code attached

  • This tutorial was purchased 1 time and rated A- by students like you.
  • Posted on May 06, 2008 at 1:55:52PM
A:
Preview: ... r p = new TeamLeader("Robin Hood", "333-M", 1985, 8, 21);<br> p.setShift(2); //value of Shift set to 2 - night<br> p.setRate(75.5); //set value of hr rate <br> p.setMinTrHr(15.5); //set value of min reqd. training hr<br> p.setSpentTrHr(24.0); //set value of spent hrs in training<br> p.setBonus(40.0); //set monythly Bounus to 40<br><br> TeamLeader[] staff = new TeamLeader[5]; <br> //array of 5 worker records<br> <br> staff[0] = p; //set 1st record to p<br> staff[1] = new TeamLeader("Peter Parker", "911-A", 1996, 10, 6);<br> //record takes default values for Shift=1, hrRate=30.5, <br> //mBonus = 50.5, minTrHr= 20.5, spentTrHr = 0<br> //as these are not being set<br><br> staff[2] = new TeamLeader("Bruce Wayne", "222-B", 1995, 11, 5);<br> <br> <br> staff[3] = new TeamLeader("Clark Kent", "444-C", 2005, 1, 15);<br> String OldName = Staff[3].getName(); <br> //store Name in variable OldName<br> staff[3].setName("Flash Gordon"); <br> //set Name to a different one<br> String NewName = Staff[3].getName(); <br> //store new name in another variable<br> System.out.println(OldName + " has changed name to " + NewName);<br><br> System.out.println("Please enter Employee Name");<br> String name = in.nextLine();<br> <br> do<br> {<br> System.out.println("Please enter Employee No in XXX-L format, X --> 0-9, L -->A-M");<br> String n = in.nextLine();<br> String no = no.toUpperCase();<br> len = no.length();<br> short = no.substring(0,3);<br> ...

The full tutorial is about 556 words long plus attachments.

Attachments:
DetTeamLeader.java (7K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty