Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Upload three files (program.cs),(Employee.cs), and (Department.cs) or C# solution with all files Create a new project, and within it, import Employee class and create
Upload three files (program.cs),(Employee.cs), and (Department.cs) or C# solution with all files Create a new project, and within it, import Employee class and create a new class named "Department" Update Employee by removing attribute department(string) implementing ToString method to print information about employee Department class has 4 attributes: name (string), int (id), location (string), employees (Employee array) constructor that accept values for name(string), id(int), location(string), and numberOfEmployees(int) initialize employees array using numberOfEmployees and set all array elements to be null use C# property to get and set values for all attributes lookupEmployeeByName method: search for employee by name(use Array.find() or Array.FindAll() as helper function). It returns true if at least one employee is found) input:string output:bool addEmployee(Employee emp)method: add employee to employees array. If the array null/empty spots then use them, otherwise use Array.Resize to update the array input:object of Employee (Employee emp) output:void removeEmployee method: remove Employee from employees array. If employee is removed successfully return true otherwise return false.(use Array.find() and Array.IndexOf()) input:object of Employee (Employee emp) output: bool print method: prints information about the department input:void output: void Within the main method, instantiate one instance(object) of the Department class denoting it as dept1 oset numof Employees pass to constructor to 2 use removeEmployee() to remove and employee use addEmployee() to add 3 employees using print() to print information about dept use lookupEmployeeByName() to search for an employee use removeEmployee() twice to remove an employee added with addEmployee() function using print() to print information about dept
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres how you could structure your code based on the requirements given Employeecs csharp public class Employee public string Name get set public int ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started