+
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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载