Question
1. Write a program named Employee.java that is a class representing an Employee that has the following Attributes (Instance Variables) Employee ID int Employee Name
1. Write a program named Employee.java that is a class representing an Employee that has the following Attributes (Instance Variables) Employee ID int Employee Name String Employee Status boolean Employee Salary double Company Name String (This is a static variable) Step 2: Write a no-arg constructor that assigns values for the above Instance Variables as follows: Employee ID = -1 Employee Name = Unknown Employee Status = false Employee Salary = 0 Step 3: Write a constructor that takes ID, Name and Status as input parameters and assign those values to the Instance Variables Step 4: Write getter methods to return each of the 4 Attributes above Step 5: Write a setter method to set the salary of an Employee based on the input parameter the method will receive Step 6: Write a program named MyCompany.java Step 7: Create an emp1 object and use the no-arg constructor Step 8: Print the Company Name Step 9: Print the output of the emp1 object as in screenshot below Step 10: Create an emp2 object and give the appropriate values for ID, Name and Status Step 11: Prompt the user for Salary. Step 12: Get the input and call the setter method on the emp2 object to set the Salary Step 13: Print the Company Name Step 14: Print the output of the emp2 object as in screenshot BELOW SAMPLE RUN OF PROGRAM ABC Inc. ID: -1 Name: Unknown Status: false Enter Salary for this Employee>>9000 ABC Inc. ID: 101 Name: ABC Status: true earns $9000.0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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