Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.51 KB

File metadata and controls

58 lines (42 loc) · 1.51 KB

C++ Module 05

This module explores C++ exceptions, abstract classes, inheritance, and factory patterns through a humorous bureaucracy simulation with Bureaucrats, Forms, and Interns.

🛠️ Usage

For each exercise, navigate to its folder, compile, and run:

📂 ex00

cd ex00
make
./ex00

📂 ex01

cd ex01
make
./ex01

📂 ex02

cd ex02
make
./ex02

📂 ex03

cd ex03
make
./ex03

📝 Exercise Descriptions

ex00 — Mommy, when I grow up, I want to be a bureaucrat!: Implement a Bureaucrat class with constant name and grade (1–150). Add grade increment/decrement, exceptions, and a stream insertion (<<) overload.

ex01 — Form up, maggots!: Add a Form class requiring a grade to sign and execute. Bureaucrats can sign forms if their grade is high enough.

ex02 — No, you need form 28B, not 28C...: Create an abstract AForm base class and concrete forms: ShrubberyCreationForm, RobotomyRequestForm, and PresidentialPardonForm, each with unique behaviors and grade requirements. Implement form execution and error handling.

ex03 — At least this beats coffee-making: Implement an Intern class with a makeForm() factory function that creates forms by name. Avoid ugly if/else chains; use elegant design.

💼 Connect

If you have any questions or suggestions, feel free to connect: 🔗 LinkedIn: Valentina Nguyen 🙋‍♀️

🖥️ System Compatibility

This project was developed and tested on Linux (Ubuntu).