Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives Exploring Inheritance and Overriding Methods Be able to design inheritance class relationships Be able to use an abstract class Be able to override a

Objectives

  • Exploring Inheritance and Overriding Methods
  • Be able to design inheritance class relationships
  • Be able to use an abstract class
  • Be able to override a virtual methods and implement an abstract method

Pre-Lab Questions

  1. Give an example of a good use of an abstract class not mentioned in the class.
  2. How many children can any parent class have? How many parents can a child class have?
  3. How can you make sure a method is not overridden in a child class?

Activities:

In this lab activity, we design an inheritance hierarchy containing types of employees in a companys payroll application. In this company, commission employees (who will be represented as objects of a superclass) are paid a percentage of their sales, while base-salaried commission employees (who will be represented as objects of a subclass) receive a base salary plus a percentage of their sales.

You need to implement the following design.

In the Testapplication you need to create a commissionEmployee object and a BasePlusCommissionEployee object using a data of your choice. Then call the toString method and print the earning on each object.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

What are the major advantages of the eight-sheet posters?

Answered: 1 week ago

Question

46. GivenMX(t).2.3et.5e3t, ndp(x), E(X), V(X).

Answered: 1 week ago