/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/07/17 15:10:40 by bchanot #+# #+# */ /* Updated: 2025/12/29 19:26:11 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "Bureaucrat.hpp" #include "Form.hpp" #include #include int main( void ) { Bureaucrat* bob = new Bureaucrat("bob", 150); Bureaucrat* jimmy = new Bureaucrat("jimmy", 1); Form* form; try { form = new Form("B_24", 150, 80); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } try { form = new Form("B_23", 160, 70); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } try { form = new Form("B_22", 0, 70); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } try { form = new Form("B_21", 80, 0); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } try { form = new Form("B_20", 70, 151); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } std::cout << *form << std::endl; std::cout << *bob << std::endl; std::cout << *jimmy << std::endl; try { bob->incrementGrade(); jimmy->incrementGrade(); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } std::cout << *bob << std::endl; std::cout << *jimmy << std::endl; try { jimmy->decrementGrade(); bob->decrementGrade(); bob->decrementGrade(); } catch (std::exception & e) { std::cout << "Exception " << e.what() << std::endl; } std::cout << *bob << std::endl; std::cout << *jimmy << std::endl; bob->signForm(*form); jimmy->signForm(*form); std::cout << *form << std::endl; delete (bob); delete (jimmy); delete(form); return (0); }