Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write the answer for this in C++. Thank you in Advance. Step 1 Create the UML class diagram to show the inheritance relationship between
Please write the answer for this in C++. Thank you in Advance.
Step 1 Create the UML class diagram to show the inheritance relationship between the Parent class, the Children classes, and the Grandchild class Open Visio and create a new diagram using the UML Class template Save the diagram as Week 5-Inheritance UML Class Diagram. Drag a class shape to your work area. o Change the class name to Employee. o Add the following attributes, and make them protected so that the child classes have direct access to thenm fName as a string IName as a string ssn as a string phone as a string o Add the following methods, and make them virtual so that the Child classes can override them. calculatePay0 that returns a float toString() that returns a string Now, let's do some inheritancel Drag another class shape to your work area, and place it on the right side of the Employee class. o Change the class name to Hourly. Add the following attributes and make them private because we do not expect to create Child classes off of the Hourly class. Notice that we do not need to add fName, IName, ssn, or phone attributes. We will inherit these attributes from the Parent class! hours as a float rate as a float o Add the following methods to override the parent's methods and to allow the child objects to behave differently than the parent objects calculatePay) that returns a float toString0 that returns a string Let's do some more inheritancel Drag another class shape to your work area, and place it below the Employee class. o Change the name to Salary. o Add the following attribute, and make it protected because we are going to make a Child class off of the Salary class. Can a child be a parent? You betl In real life, your mom is someone's child. In software development, the Child class can be a Parent class for another child - annualSalary as a doubleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started