Pizza King Program in Java | Practice Questions

In main method, call the method performPizzaKingOperations. 1. orderPizza : This method will compare both orders, if they are same, even with different cases, then the method will throw a DuplicateOrderException

2. performPizzaKingOperations: This method takes parameters of pizza name that we want to order. For example Tomato , Capsicum, etc. Call orderPizza method from here.

Exceptions should be handled in performPizzaKingOperations method only. This method should also be able to handle any other type of exceptions which are not known or declared. The performPizzaKingOperations method will execute for following scenarios depending on the 2 inputs provided and return an integer value as the result of execution.

Everything works successfully for order names, for ex. Onion and Capsicum, then return 0 If both orders are same/duplicate , for example paneer and Paneer, and the DuplicateException was encountered then return -1

If any unknown exception occurs, then the result should be returned as -2. efore exiting this method in any case, a result should be returned.

Get Project Solution Now

Comments