Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Can anybody help me in this?

+1 vote
asked May 12, 2020 by atul sharma (130 points)
Collection Framework (no legacy class/interface) Exercise:

Create an class named Employee with the following private attributes / member variables.

String name

List<Address> addressList;

Department dept

Include a 4-argument constructor.

Include getters and setters.

Include an method named printEmployeeDetails() .

 Create a class named Address . Include the   following private attributes / member variables.

String city

String country

Char type; //p - permanent, r means current resisdence -only two types.

Include a 3-argument constructor.

 Include getters and setters.

Create a class named Department . Include the following private attributes / member variables.

List<Technology> tech;

Include a 1-argument constructor.

 Include getters and setters

Create a class named Technology . Include the following private attributes / member variables.

String skillName;

Include a 1-argument constructor.

 Include getters and setters.

Create another class called Example11Main. In the method, create instances of the above classes and test the above classes.

All text in bold corresponds to input and the rest corresponds to output.

Rules: only two address can be added, only one department can be added to an employee details

Sample Input and Output:

Enter the Employee name

Anbu

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

p

Enter the city

Chennai

Enter the country

India

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

r

Enter the city

Chennai

Enter the country

India

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

r

Enter the city

Banglore

Enter the country

India

Do you want to add address? no

Enter the skill

Java

Do you want to add Employee? yes

Enter the Employee name

Arasu

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

p

Enter the city

Chennai

Enter the country

India

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

p

Enter the city

Banglore

Enter the country

India

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

r

Enter the city

Banglore

Enter the country

India

Do you want to add address? no

Enter the skill

.NET

Do you want to add Employee? yes

Enter the Employee name

Arun

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

p

Enter the city

Chennai

Enter the country

India

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

p

Enter the city

Banglore

Enter the country

India

Do you want to add address? yes

Enter the Address type (p-permanent, r-residence):

r

Enter the city

Banglore

Enter the country

India

Do you want to add address? no

Enter the skill

Java

Find employees of city: Chennai

Anbu | Java

Find employees of country: India

Anbu | Java

Arasu | .NET

Arun | Java

Find employees of skill: .NET

Arasu | .NET

1 Answer

0 votes
answered Jul 27, 2020 by saif khalid saif salem almansoori (470 points)
this is java programming code
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...