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

  Internet, internet, intranet

Define the terms internet, Internet, intranet and extranet, highlighting the similarities and differences between them.

  Explain whetherucita should or should not be adopted

What are your arguments in support of these points? You really did not answer the question as these don't really explain whether you believe the UCITA should or should not be adopted.

  What is the value of the key and the new register

In the n-stage nonlinear feedback shift register (NLFSR), if the current register is 0010, function f is f(R3, R2, R1, R0) = R3 or R2 or R1 or R0,what is the value of the key and the new register?

  Write the function xsort which takes in a list of strings

Write the function Xsort wich takes in a list of strings and returns sorted list with all words beginning wih "X" first in the list. f.ex: xsort (['kex', 'xylofonn', 'epli', 'xenos', 'asni']) returns ['xenos', 'xylofonn', 'asni', 'epli', 'kex'] th..

  Study impact of global environmental policy

Consider how neighboring countries are affected, also emergent issues like new arctic shipping routes, or the international interest in Africa's natural resources. Study impact of global environmental policy associated with these issues.

  What know by statement mydog setname bowser

what do you know by the following statement: myDog.setName("Bowser")

  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.

  Discuss the different html/css versions and browser versions

HTML versus XHTML - Discuss the different HTML/CSS Versions and Browser Versions

  Create and validate html documents

Describe the structure of the World Wide Web as interconnected hypertext documents and create and validate HTML documents.

  Explaining it solutions to enhance workflows

The final method to include IT is not to go "looking for IT solutions" just for sake of using IT. But to have IT at the table to truly think about ways to develop workflows.

  Create an incident-response policy

Create an incident-response policy that covers the development of incident-response team, disaster-recovery processes, and business-continuity planning.

  The centroid and the cluster

Problem 1.  For the following set of points, the initial centroid, and the cutoff distance of 4, do the following operations: 1) find the clusters; 2) update the centroid value; 3) find the distance between the centroid and the cluster, and update th..

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