Home / Expert Answers / Computer Science / write-the-pseudocode-and-subsequent-c-code-for-the-given-scenario-define-a-2-classes-34-developer-pa238

(Solved): Write the pseudocode and subsequent C++ code for the given scenario. Define a 2-Classes "Developer ...



Write the pseudocode and subsequent C++ code for the given scenario.
Define a 2-Classes Developer and Driver, derived fro

Write the pseudocode and subsequent C++ code for the given scenario. Define a 2-Classes "Developer" and "Driver", derived from the class "Employee" with the member functions getSalary() to compute salary of Developer and Driver. Here getSalary() is the method to be redefined (Overriding) in both the derived classes "Developer" and "Driver". Fate The rule here is that the Compiler selects the function to be called based on the contents of the pointer bptr, and not on the data type of the pointer. This selection is made during the execution of the program because how does Compiler know which function to link when it doesn't know which object's address bptr is going to contain at runtime. It could be the address of an object of the "Employee" class or of the "Developer" class or of the "Driver" class. Note: 1. Not to create any objects for "Driver"/"Developer" Class. Create a pointers for a class "Employee" and store the instance addresses of "Driver"/"Developer" Class. 2. Compute Salary: a. For Developer: Salary Basic +DA+HRA (DA-30% of Basic and HRA-20% of Basic) b. For Driver: Salary-Basic; Input • First Line must read a choice either 'R' - for Driver or 'D' - for Developer . Second line read the Basic Salary Output • Compute and print the salary based on the choice (R/D) • If Choice is neither 'R' nor 'D', then print "Invalid Choice"


We have an Answer from Expert

View Expert Answer

Expert Answer


*********************here is the solution please upvote .happy chegging******************************* Have explained the working of the code and all the lines of the code with the help of comments but if you still have any doubt then please comment.
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe