Monmouth University CS

CS310 Polymorphism Exercise

0/9 TODOs · 0/6 predictions

Steps

Class Diagram

Post-Exercise Survey

Survey QR Code Or click here to open survey
idle
Monmouth CS

CS310 — Polymorphism Exercise

Employee & Manager Class Hierarchy

Welcome!

In this exercise you'll implement 6 key methods in a C++ Employee/Manager class hierarchy. The rest of the code is already written for you.

📝
Virtual Functions & Override

Employee::toString() is virtual, Manager overrides it

🔗
Inheritance & Polymorphism

Manager IS-A Employee — use Employee* to point to Managers

⚙
Operator Overloading

operator== compares employees by ID

How It Works

1
Follow the Steps

Click each step in the left sidebar. It will open the right file and scroll to the TODO you need to implement.

2
Read the TODO Instructions

Each TODO has detailed comments explaining what to implement, with examples of expected input/output.

3
Write Your Code

Replace the placeholder (e.g., return false;) with your implementation. The code already compiles — you just need to make it correct.

4
Run & Check

Run compiles and executes your code. Check runs 14 automated tests to verify your implementation.

Features

🔮
Prediction Challenges

After implementing each TODO, you'll be asked to predict the output before running. A mini-lesson explains the polymorphism concept.

💡
Hints

Stuck? Click the Hint button on any step for progressive help — nudge first, then approach, then code example.

🔒
Read-Only Files

Files marked with a lock icon are pre-written for you. You can read them but not edit — focus on the TODO files.

💾
Auto-Save

Your code is automatically saved in your browser. You can also Export/Import as a zip file.

🤔 Predict the Output

What will this code output?


        
      

Your Prediction

          
Actual Output