| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* main.cpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* 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 <iostream>
- #include <limits>
- 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);
- }
|