need this code to be solved within 20 min please c) Staff is another subclass of the Employee class and contains a priva

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

need this code to be solved within 20 min please c) Staff is another subclass of the Employee class and contains a priva

Post by answerhappygod »

need this code to be solved within 20 min please
c) Staff is another subclass of the Employee class and contains
a private data field
salary. A constructor that creates a Staff object with specified
name and salary
amount. Print the assigned name of the Staff object using the
property. Staff class
overrides and defines the body of the Psalary method to return the
salary of the
Staff.
d) A driver class is called as Demo has the Main method and inside
Main it creates
a Faculty object (f) with a name “Mrs. Roma” and a salary amount.
It also creates
a Staff object with a name “Mr. Karim” and a salary amount. Use
appropriate
property variable and Psalary method to print the Faculty and Staff
object’s name
and salary.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply