Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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;
}

}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9885683

Have any Question?


Related Questions in Computer Engineering

Assignment wireless applications advances advantages and

Assignment: Wireless Applications, Advances, Advantages, and Disadvantages The adoption of wireless technologies varies from one industry to another, and is often based on the benefits provided versus the challenges, imp ...

Discuss how today the internet has brought millions of

Discuss how today, the internet has brought millions of unsecured computer networks into communication with each other.

Question specify design and implement a class for a card in

Question : Specify, design, and implement a class for a card in a deck of playing cards. The object should contain methods for setting and retrieving the suit and rank of a card. In C++ please

Explain that when an unauthorized individual gains access

Explain that when an unauthorized individual gains access to the information an organization trying to protect, that act is categorized as a deliberate act of espionage or trespass.

The contracts manager at a company needs to make a large

The contracts manager at a company needs to make a large legal document available to an overseas customer. However, she has some challenges: The document contains sensitive information; it is too large to send via e-mail ...

Question wireless transmission please respond to the

Question: Wireless Transmission" Please respond to the following: • Organizations need to be careful about their wireless transmissions and controlling the reception of the wireless signal. Discuss ways that organization ...

A supermarket awards coupons depending on how much a

A supermarket awards coupons depending on how much a customer spends on groceries. For example, if you spend $50, you will get a coupon worth eight percent of that amount. The following table shows the percent used to ca ...

The next four questions are based on the following you

The next four questions are based on the following: You invested a lump sum of $50,000 in a new company ten years ago and left it there without any further investments and now, today, the company listed on the stock exch ...

If a wooden car has 30 independent components that all must

If a wooden car has 30 independent components that all must function for the wooden car to operate successfully during a race, and the probability of successful operation for any single component is 0.999, what is the pr ...

Titan mining corporation has 75 million shares of common

Titan Mining Corporation has 7.5 million shares of common stock outstanding, 275,000 shares of 4.7 percent preferred stock outstanding, and 160,000 bonds with a semiannual coupon rate of 5.6 percent outstanding, par valu ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As