The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Had issues with applying in vs. Details attached below.
Â
The only change to the Employee class is that there is a new attribute:+benefit : BenefitNotice that there is a "+" for this attribute, meaning that it is public. Make sure to examine themulti-arg constructor's signature!Also, the dotted directed line between Employee and iEmployee specifies that the Employeeclass must implement the iEmployee abstract class, and thus provide an implementation for thecalculatePay method.1.Using the UML Diagrams from Step 1, create the Benefit class. To get an idea of how toformat displayBenefits, take a look at the output in Step 5.2.Add a Benefit attribute to the Employee class.3.Initialize the new Benefit attribute in both Employee constructors. Again, take note of themulti-arg constructors parameter list!4.Create the iEmployee interface (abstract class in C++).5.Modify the Employee class to implement the new interface so that Employee will have toimplement the calculatePay method.6.Modify the Employee class to call displayBenefit when displaying Employeeinformation.Notice that the Employee class now has a public benefit object inside it. This means that you canaccess the set methods of the Benefit object with the following code:<Employee object>.benefit.<method>As an example, to set the lifeInsurance attribute inside an Employee object called emp, we couldexecute the following code:emp.benefit.setLifeInsurance(lifeInsurance);The steps required to modify the Main class are below. New steps are in bold.1.Create an Employee object using the default constructor.2.Prompt for and then set the first name, last name, and gender. Consider using yourgetInput method from Week 1 to obtain data from the user for this step as well as Step 3.
Attachments:
-----------