Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given that HourlyEmployee and SalariedEmployee are subclasses of FullTimeEmploye

ID: 3709048 • Letter: G

Question

Given that HourlyEmployee and SalariedEmployee are subclasses of FullTimeEmployee, suppose we have: FullTimeEmployee fullnew FullTimeEmployee(); HourlyEmployee hourlynew HourlyEmployee (); SalariedEmployee salaried new SalariedEmployee (: full salaried Which one of the following assignments would be legal both at compile time and at run-time? a. salaried (SalariedEmployee) full; b salaried-full c. salaried-(FullTimeEmployee) full; d. hourly-HourlyEmployee) full; Create a small project to validate your claim.

Explanation / Answer

Answer: a. salaried = (SalariedEmployee) full;

salaried = (SalariedEmployee) full; is the legal both at compile and runtime

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote