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

  Procedural considerations

The processes and procedural considerations the organization would/will need to understand to mitigate your key points?

  Distinguish online learning with classroom learning

Write the exploratory essay in which you distinguish online learning with classroom (on-ground) learning. Your estimation may incorporate preparation time.

  Discuss benefits of working with shell scripts

Discuss the benefits and provide examples of working with shell scripts.

  What are some of the unique features that become available

What are some of the unique features that become available when either the forest or the domain is changed to the 2008 functional level? What about 2008 R2? What features are lost when moving to either of the 2008 functional levels?

  What is the unit of data working in the data link layer

What is the unit of data working in the Data Link layer?

  Display the total sales with ah dollar sign

Display the total sales with ah dollar sign and two decimal places. I have no idea how to code this add button.The code has to work for Visual Basic. Thank you.

  Two-dimensional arr named number of three rows

Given a two-dimensional arr named number of three rows and four columns of type ont, write the nigle code statement that both declare and initialize the arry such that the first row is initialize to 0,1,2,3, the second row is initialized to 4,5,6,..

  Write a c++ program that calculates distance of a golf ball

write a C++ program that calculates the distance of a golf ball fallen in with each one-seconds interval drop from airplane calculate the distance in the current time Interval (ft) and total distance the golf ball falls at the end of each interval..

  Define a lan-to-wan, internet, and web surfing

Richman Investments requires the enforcement of strict ingress-egress filtering policies for network traffic. Certain traffic is expressly forbidden:

  What is the smallest negative number

given a tiny computer that has a word size of 6 bits, what is the smallest negative number that this computer can represent if it uses two's complement form

  Write program displays the following pattern on the screen

Write a program that displays the following pattern on the screen

  Why is this beneficial to the paging algorithm

Why is this beneficial to the paging algorithm and the performance of the system?

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