/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/07/17 15:10:40 by bchanot #+# #+# */ /* Updated: 2025/12/29 16:12:36 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "Bureaucrat.hpp" #include #include int main( void ) { Bureaucrat* bob = new Bureaucrat("bob", 150); Bureaucrat* jimmy = new Bureaucrat("jimmy", 1); 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; Bureaucrat* tooHigh; try { tooHigh = new Bureaucrat("TooHigh", 0); } catch (std::exception & e) { std::cout << "Exception : " << e.what() << std::endl; } Bureaucrat* tooLow; try { tooLow = new Bureaucrat("TooLow", 151); } catch (std::exception & e) { std::cout << "Exception : " << e.what() << std::endl; } (void)tooLow; (void)tooHigh; delete (bob); delete (jimmy); return (0); }