From the course: Advanced C#: Object-Oriented Programming

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Challenge: Abstract employee class

Challenge: Abstract employee class - C# Tutorial

From the course: Advanced C#: Object-Oriented Programming

Challenge: Abstract employee class

(upbeat music) - [Instructor] For our final programming challenge, we're going to apply the lessons of this chapter to the employee classes that we've built up in the previous challenges. So if we look at the code as we left it in the last challenge, we can see that there's some room for improvement. First, we don't want developers to be able to instantiate the employee base class. They should have to choose between either hourly employee or salaried employee. Next, notice how the adjust pay method is defined in the employee base class and has an empty implementation. We should require that derived classes implement this method for themselves. And then finally, let's make sure that the hourly and salaried employee classes can't be extended any further. We've learned how to do all three of those things in this chapter, so let's put that knowledge to work in this challenge. And I'll explain my solution in the next video.

Contents