You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This exercise involves designing a Bureaucrat class. It has a constant name and a grade (1 to 150). Attempts to instantiate a Bureaucrat with an invalid grade must throw Bureaucrat::GradeTooHighException or Bureaucrat::GradeTooLowException. Getters for name and grade are required, along with member functions to increment or decrement the grade, which also throw exceptions if the grade goes out of range. An overload of the insertion (<<) operator is to be implemented for printing bureaucrat information.
This project involves creating a Form class with a constant name, a boolean indicating if it is signed (initially false), and constant grades required to sign and execute it. Grade rules are similar to Bureaucrat, throwing Form::GradeTooHighException or Form::GradeTooLowException for invalid grades. Getters for all attributes and an overloaded << operator are required. A beSigned() member function takes a Bureaucrat and attempts to sign the form if the bureaucrat's grade is sufficient, throwing Form::GradeTooLowException if not. The signForm() member function in the Bureaucrat class is modified to call Form::beSigned() and print appropriate success or failure messages.
This exercise involves developing concrete form classes (e.g., ShrubberyCreationForm, RobotomyRequestForm, PresidentialPardonForm) that inherit from an abstract AForm class, demonstrating polymorphism.