The sixth C++ module of the 42 curriculum, focused on repetition and exceptions.
This project introduces exception handling, abstract classes, and inheritance chains, building a bureaucratic system where forms can be created, signed, and executed by bureaucrats of varying grades.
Each exercise (ex00 to ex03) contains its own Makefile. Compile and run individually:
cd ex00
make
./bureaucrat- ex00: Bureaucrat class with grade validation using custom exceptions inheriting from
std::exception. - ex01: Form class with grade requirements for signing, and
signForm()/beSigned()interaction. - ex02: Abstract
AFormbase class with pure virtualexecute(), and three concrete forms:ShrubberyCreationForm,RobotomyRequestForm,PresidentialPardonForm. - ex03:
Internclass with amakeForm()factory using an array of function pointers to avoid if/else chains.
Each exercise is self-contained in its own directory with its own source files, headers, and Makefile, following the standard 42 module layout.