Question: please help me solve this is in java language it has 4 questions 1.1 Given that HourlyEmployee and Salaried Employee are subclasses of Full TimeEmployee,

please help me solve this is in java language it has 4 questions
 please help me solve this is in java language it has
4 questions 1.1 Given that HourlyEmployee and Salaried Employee are subclasses of
Full TimeEmployee, suppose we have: FullTimeEmployee full-new FullTimeEmployee(): HourlyEmployee hourly = new

1.1 Given that HourlyEmployee and Salaried Employee are subclasses of Full TimeEmployee, suppose we have: FullTimeEmployee full-new FullTimeEmployee(): HourlyEmployee hourly = new HourlyEmployee 0: SalariedEmployee salaried = new SalariedEmployee 0; full = salaried Which one of the following assignments would be legal both at compile- time and at run-time? a. salaried = (SalariedEmployee) full; c. d. b. salaried = full; salaried = (Full TimeEmployee) full; hourly = (Hourly Employee) full; Create a small project to validate your claim. 1.2 Assume that the classes below are all in the file Polymorphism.java. Determine the output when the project is run. Would the output be different if the call to printin were System.out.println (a.toString()? import java.util."; public class Polymorphism public static void main(String args[]). Scanner sc = new Scanner (System.in); A a: Int code = sc.nextInt(): if (code ==0) a = new A 0: else // non-zero in entered a = new DO: 1.2 Assume that the classes below are all in the file Polymorphism.java. Determine the output when the project is run. Would the output be different if the call to printin were System.out.println (a.toString()? import java.util." public class Polymorphism public static void main(String args[]) Scanner sc = new Scanner(System.in); A a; int code = sc.nextinto: if (code == 0) a = new A 0: else non-zero intentered a = new DO Page 56 System.out.println (a): method main }//class Polymorphism class A public String toString 0 return "A": method toString ) / class A class D extends A public String toString 0 return 'D': > // method to String }/class D 1.3 In the Employee class, modify the toString method so that the gross pay is printed with a comma to the left of the hundreds digit. For example, if the name is O'Brien, Theresa" and the gross pay is 74400.00, the toString method will return O'Brien, Theresa $74,400.00 1.4 What can you infer about the identifier out from the following message? System.out.printin ("Eurekal"); What is the complete declaration for the identifier out? Look in java.lang.System.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!