Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the template below create an array of object in java displaying the data of 3 employee. Statement 1 is creating an array of Employee

Using the template below create an array of object in java displaying the data of 3 employee. Statement 1 is creating an array of Employee Emp to store the records of 3 employees.

/******************* Name:

Date:

Notes: *******************/

//Employee.java

import java.util.Scanner;

class Employee

{

datatype var1;

datatype var2;

- - - - - - - - - -

datatype varN;

void GetData() // Defining GetData()

{

Scanner sc = new Scanner(System.in);

Add content

}

void PutData() // Defining PutData()

{

System.out.print(

}

public static void main(String args[])

{

Employee[] Emp = new Employee[3];

int i;

for(i=0;i<3;i++)

// Allocating memory to each object

for(i=0;i<3;i++)

{

System.out.print("

getdata

}

System.out.print(...

For statement

putdata

}

}

The output should contain the following:

Output:

Enter details of 1 Employee

Enter Employee Id : 1001

Enter Employee Name : Davis

Enter Employee Age : 40

Enter Employee Salary : 65000

Enter details of 2 Employee

Enter Employee Id : 1002

Enter Employee Name : McKnight

Enter Employee Age : 35

Enter Employee Salary : 41000

Enter details of 3 Employee

Enter Employee Id : 1003

Enter Employee Name : Daniels

Enter Employee Age : 28

Enter Employee Salary : 27000

Details of Employees

1001 Davis 40 65000

1002 McKnight 35 41000

1003 Daniels 28 27000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago