Skip to content
/ cpp05 Public

This module introduces exception handling and explains how to use casting and type conversions.

Notifications You must be signed in to change notification settings

ngtina99/cpp05

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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).

About

This module introduces exception handling and explains how to use casting and type conversions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published