E2a: Create a class called Employee that includes three pieces of information as data members---a first name (char array), last name (char array) and a monthly salary (integer). Your class should have a constructor that initializes the three data members. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10 percent raise and display each Employee’s yearly salary again.
Sample output:

Your solution:
#source code in java
Employee.java
import java.util.*;
import java.lang.*;
class Employee{
String first_name;
String last_name;
int salary;
static int i=1;
static int j=1;
Employee(String first,String last,int sal){
this.first_name=first;
this.last_name=last;
this.salary=sal;
}
void display(){
if(salary<0){
System.out.println("Employee
"+i+":"+first_name+" "+last_name+" Salary:"+0*12);
i=i+1;
}
else{
System.out.println("Employee
"+i+":"+first_name+" "+last_name+" Salary:"+salary*12);
i=i+1;
}
}
void display2(){
if(salary<0){
System.out.println("Employee
"+j+":"+first_name+" "+last_name+" Salary:"+0*12);
j=j+1;
}
else{
double x=0.1;
double
temp=0.1*(double)salary;
System.out.println("Employee
"+j+":"+first_name+" "+last_name+"
Salary:"+(salary+(int)temp)*12);
j=j+1;
}
}
public static void main(String args[]){
Employee a=new
Employee("Bob","Jones",2875);
Employee b=new
Employee("Susan","baker",3150);
a.display();
b.display();
System.out.println("\nIncreasing
Employee Salaries by 10%\n");
a.display2();
b.display2();
}
}
#output:

#if you have any doubt comment below....
E2a: Create a class called Employee that includes three pieces of information as data members---a first...
c++ only Design a class representing an Employee. The employee would have at least these private fields (Variables): name: string (char array) ID: string (char array) salary: float Type: string (char array) All the variables except for the salary should have their respective setters and getters, and the class should have two constructors, one is the default constructor and the other constructor initializes the name,ID and type of employee with valid user input. The class should have the following additional...
Create a class called Customer that includes three pieces of information as instance variables - a firstname (type string), a last name (type string) and a credit limit (double) Your class should have a constructor that initializes the three values. a. Provide a customer that initializes these three instance variables. Validate credit limit; it must be greater than 0.0. b. Provide set and get methods for each instance variable. Validate credit limit; it must be greater than 0.0. Write a...
Create a class called Employee that includes three instance variables—a first name, a last name, and a monthly salary. Code the default (no-args, empty) constructor. Provide a set and a get method for each instance variable. If the monthly salary is not positive, do not set its value.
In one file create an Employee class as per the following specifications: three private instance variables: name (String), startingSalary (int), yearlyIncrement (int) a single constructor with three arguments: the name, the starting salary, and the yearly increment. In the constructor, initialize the instance variables with the provided values. get and set methods for each of the instance variables. A computation method, computeCurrentSalary, that takes the number of years in service as its argument. The method returns the current salary using...
In Java: Executable Class create an array of Employee objects. You can copy the array you made for Chapter 20. create an ArrayList of Employee objects from that array. use an enhanced for loop to print all employees as shown in the sample output. create a TreeMap that uses Strings for keys and Employees as values. this TreeMap should map Employee ID numbers to their associated Employees. process the ArrayList to add elements to this map. print all employees in...
Please write in C# and create a UML design. 1. Create an Employee class. Items to include as data members are employee number, first name, last name, and monthly salary. Include default and overloading constructors , also include a method that calculates the annual pay of the employee, and a method to display the information of the employee. Create a second class to test your Employee class by instantiating two Employee objects and display all the above information of each...
Create a C# Console program. Add a class named Employee that has the following public fields: • Name. The name field references a String object that holds the employee’s name. • IDNumber. The IDNumber is an int that holds the employee’s ID number. • Department. The department field is a String that holds the name of the department where the employee works. • Position. The position field is a String that holds the employee’s job title. Once you have written...
Part (A) Note: This class must be created in a separate cpp file Create a class Employee with the following attributes and operations: Attributes (Data members): i. An array to store the employee name. The length of this array is 256 bytes. ii. An array to store the company name. The length of this array is 256 bytes. iii. An array to store the department name. The length of this array is 256 bytes. iv. An unsigned integer to store...
JAVA PROGRAMMING Create an Employee class which implements Comparable<Employee> The constructor consists of an employee’s first name and an employee’s salary, both of which are instance variables. Create accessor and mutator methods for both of these variables Write an equals method that returns true if the salaries are equal with one cent and the names are exactly equal Write a compareTo method that returns 1 if the salary of this employee is greater than the salary of the comparable, -1...
C# Language please. Create an “Employee” class with six fields: first name, last name, workID, yearStartedWked, initSalary, and curSalary. It includes constructor(s) and properties to initialize values for all fields (curSalary is read-only). It also includes a calcCurSalary function that assigns the curSalary equal to initSalary. Create a “Worker” classes that are derived from Employee class. In Worker class, it has one field, yearWorked. It includes constructor(s) and properties. It also includes two functions: first, calcYearWorked function, it takes...