Language: Use Scoping-Overriding-Overloading

Shows how to allow various levels of access to the members of a class, including Public, Private, Protected and otherwise. To demonstrate how to extend derived classes with features like Overloading and Overriding.

Featured Highlights:

This application simulates a simple hiring system, allowing for the hiring of full-time, part-time and temporary employees. Each kind of employee has specific features that set them apart from the other kinds. For example, only full-time employees get annual leave, and only temporary employees have an expected termination date when they are hired. Part-time employees are required to work at least 20 hours per week. However, all employees have many things in common: they all get hired, all have salaries, each has a name, etc.

The application utilizes a base class called Employee, from which the classes FullTimeEmployee, PartTimeEmployee and TempEmployee are derived. Each derived class extends the base class in some way: by overriding methods of the base class, by implementing new methods or properties of its own, or by replacing (shadowing) members of the base class. There is also a Friend class called EmployeeDataManager which simulates reading and writing employee data to and from a database.

The application demonstrates the use of these statements and modifiers in classes and their members:

It also demonstrates scoping with the use of these keywords:

Requirements:

Running the Sample:

Simply press F5.

See Also