Create the needed constructors

Assignment Help Basic Computer Science
Reference no: EM13306362

In this assignment you will be implementing three classes -Date (you would reuse the Date class after implementing toString() and equals() method), Employee and EmployeeTest with main method to test Employee class.

Class Employee has instance variables firstName, lastName, birthDate, hireDate and a variable to keep track of count of Employee objects. Members birthDate and hireDate are references to Date objects that have instance variables month, day and year.

Date Class
· Three instance variables month (1 - 12), day(1- 31) and year(any year) of appropriate type.
· Create the needed constructors
· Create methods setMonth( ), setDate( ), setYear ( ) with appropriate validation code
· setDate( ) method to confirm proper day value based on month and year. You can ignore the leap years.
· Create the getMethods for the instance variables
· Implement the toString() and Equals( ) method
Employee class
· Instance variables firstName, lastName, birthDate (Date type), Date hireDate (Date type)
· Variable to keep track of the count of Employee objects created. Note there will be only one copy of this variable that is shared by all the objects of this class
· Create appropriate constructors. Note that to initialize birthDate and hireDate the constructors will need parameters of Date type
· Create a method that returns the current count of the Employee objects
· Create a toString( ) and equals method ( )
EmployeeTest
· Implement the main method
· Create an Employee object with name Bob Jones with birthDate 10/14/1986 and hireDate as 5/1/2008
· Call the toString method on the Employee object and display it on the console window.
· Create another Employee object with name John Doe with birthDate 7/10/1973 and hireDate as 1/1/2012
· Call the toString method on the Employee object and display it on the console window.
· Display the current count of Employee objects by calling getCount( ) method
· Demonstrate the usage of equals method on the Employee objects.

Here is the Date class to reuse

public class Date {

private int day;
private int month;
private int year;

public Date(int day, int month, int year) {
this.day = day;
this.month = month;
this.year = year;
}

public Date() {
day = 0;
month = 0;
year = 0;
}

public void setDay(int day) {
this.day = day;
}

public void setMonth(int month) {
this.month = month;
}

public void setYear(int year) {
this.year = year;
}

public int getDay() {
return day;
}

public int getMonth() {
return month;
}

public int getYear() {
return year;
}

}

Reference no: EM13306362

Questions Cloud

Write a program to make mole take walk through the island : Many times the mole will drown. Use a counter to count the number of times it finds the bridges. Could anyone help me with this I am having trouble figuring out the loop to make the mole travel through the island.
Write java program that allows the user to enter wall space : Write a Java program (from scratch) that allows the user to enter the wall space to be painted and the price of paint per gallon.
Covert these equipment designs to normal lab apparatus : Covert these equipment designs to normal lab apparatus - But please draw them beautifully use software.
Determine the minimum uncertainty in the blocks speed : A 0.50 kg block rests on the icy surface of a frozen pond, which you can assume to be frictionless. what is the minimum uncertainty in the block's speed
Create the needed constructors : In this assignment you will be implementing three classes -Date (you would reuse the Date class after implementing toString() and equals() method), Employee and EmployeeTest with main method to test Employee class.
Determine the relative humidity using psychrometric chart : The wet bulb and dry bulb temperatures for humid atmospheric air (at 100 kPa) are measured to be 20 C and 25C respectively. Determine: a. using the psychrometric chart, the relative humidity  b. using the psychrometric chart, the humidity ratio
Prioritise the stakeholders on a project : Question 1.Why is it important to prioritise the stakeholders on a project?
Find the constraint force : A mass m slides in the bottom of a hemispherical bowl of radius R under the influence of gravity. Find the constraint force
Determine what is the adiabatic efficiency of the turbine : At the inlet the steam is at 1 MPa and 320 C, and leaves the turbine at 20 kPa. The work output of the turbine is measured to be 600 kJ/kg (of steam passing through the turbine).

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  Driving force causing this evolution

Discuss the evolution of client-server computing from file server to multilayer applications to Web-based applications. What has been the driving force causing this evolution? Where do you think network computing will be in the next five years? Ten y..

  Odd-length cycle in directed graph by linear-time algorithm

Give a linear-time algorithm to find an odd-length cycle in a directed graph. You may NOT assume that the graph is strongly connected.

  Evaluating average degree of a vertex for geometric graph

For random geometric graph, G(n, r), evaluate average degree of a vertex: at least distance r from boundary, on boundary (convex hull), and estimate time (big Oh) of determining all edges employing: all vertex pairs testing.

  Full-duplex trunk between end office-intermediate switch

In a simple telephone network comprising of two end offices and one intermediate switch with 1-MHZ full-duplex trunk between each end office and intermediate switch.

  Difference between data block-extent-segment and tablespace

Allocation in Oracle can aid recognize problems more easily. In your own words, give the description of difference between data block, extent, a segment, and a tablespace.

  Differentiate matrix and blosum matrix

Write down the difference between matrix and a Blosum60 Blosum20 matrix? If one uses one and when other? What is meant by Clustal and summarize the operation.

  Differences between technical and technology skills

Describe in scholarly detail differences between technical and technology skills as they associate to telecommunications and how they relate to general expectations

  Implement the intrusion detection system

Company is trying to decide whether to implement the intrusion detection system (IDS), or intrusion prevention system (IPS).

  Examine the current content management

Examine the current content management, determine the strengths and weaknesses, and define improvements.

  Writing return statement in a value returning function

What would be wrong with not writing returnstatement in a value returing function? Can you have a returnstatement in a void function? Does the return statement in the following function cause syntax error?

  Prove by induction of recurrence relation has solution

Describe why Kim's recurrence relation is correct. Prove by induction that Kim's recurrence relation has solution: M(k) = 3^(k - 1).

  Write a script to help users calculate compressed file size

Develop a small console program driven by a text menu (see the sample screenshot below):? It displays a simple menu with 4 items indicated by number 1-4.? Users will enter number 1 to 4 to run some commands.?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd