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 – boo lean...


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 – boo lean 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 = -1Employee Name = “Unknown” Employee Status = false


Employee Salary = 0Step 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 My Company. 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 the program: 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 = -1Employee Name = “Unknown” Employee Status = false Employee Salary = 0Step 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 My Company. 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 the program:   2. Create a class named Student. A Student has fields for an ID number, total score earned by the Student and Grade of the Student .Add a static variable School Name and give it a name of your choice Re-use logic in program of Week 6 to compute the grade of a student and store it for this student using a setter method. Create a class My School and create 3 Student objects. For each object prompt the user for an ID Number and total score.  Display the Output as Below:------------------------------------School of Technology------------------------------------ID: 100Score: 97Grade: A+------------------------------------ID: 105Score:80Grade: A-------------------------------------ID: 110Score: 50Grade: D------------------------------------Below are for Further Practice for those interested Suppose that you have created a program with only the following variables.int a = 5;int b = 6;Suppose that you also have a method with the following header: public static void math Method(int a)Which of the following method calls are legal?a. math Method(a);b. math Method(b);c. math Method(a + b);d. math Method(a, b);   e. math Method(2361);f. math Method(12.78);g. math Method(29987L);h. math Method();   i. math Method(x);j. math Method(a / b);Suppose that you have created a program with only the following variables.int age = 34;int weight = 180;double height = 5.9;Suppose that you also have a method with the following header: public static void calculate(int age, double size)Which of the following method calls are legal?  a. calculate(age, weight);b. calculate(age, height);c. calculate(weight, height);d. calculate(height, age);e. calculate(45.5, 120);   mf. calculate(12, 120.2);g. calculate(age, size);h. calculate(2, 3);i. calculate(age);j. calculate(weight, weight);   3.a. Create a class named Lease with fields that hold a tenant’s name, apartment number, monthly rent amount, and term of the lease in months. Include a constructor that initializes the tenant’s name to “ABC”, the apartment number to 0, the rent to 1000, and the term to 12.Also include methods to get and set each of the fields. Include a method named add Pet Fee() that adds $10 to the monthly rent value. Save the class as Lease.java.  b. Create a class named Test Lease that imports the Scanner class In this class write a static method get Data()that takes a Lease object as input parameter, prompts the user for the details of Tenant Name, Apartment No, Lease Term and Rent amount AND then calls setter methods on the Lease object to set these values In this class, write another method show Values() that takes a Lease object as input parameter, and calls the getter methods on the Lease object to display the details of the Lease. Now write the public static void main method. Within the main method, declare the 1st Lease object. Call the show Values() method to display the Lease details. Now declare the 2nd Lease object Call the get Data()method on this Lease object. Call the show Values() method to display the Lease details. Call the add Pet Fee() method on this Lease object Confirm that the fee is added to the rent by calling the show Values() method for the Lease object again. Save the application as TestLease.java. Sample run of the program:


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here