0% found this document useful (0 votes)
34 views1 page

Create All Classes in Package Com (Lower Case) - Please Avoid Any Usage of System - Out.println in The Program

1) Create a PizzaKing class in the com package with a main method that calls the performPizzaKingOperations method. 2) The performPizzaKingOperations method takes pizza name parameters, calls the orderPizza method, and handles exceptions from orderPizza. 3) orderPizza compares orders, throwing a DuplicateOrderException if they are the same case-insensitively. 4) performPizzaKingOperations returns 0 if successful, -1 if a duplicate order is placed, and -2 if an unknown exception occurs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Create All Classes in Package Com (Lower Case) - Please Avoid Any Usage of System - Out.println in The Program

1) Create a PizzaKing class in the com package with a main method that calls the performPizzaKingOperations method. 2) The performPizzaKingOperations method takes pizza name parameters, calls the orderPizza method, and handles exceptions from orderPizza. 3) orderPizza compares orders, throwing a DuplicateOrderException if they are the same case-insensitively. 4) performPizzaKingOperations returns 0 if successful, -1 if a duplicate order is placed, and -2 if an unknown exception occurs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Create all classes in package com (lower case).

Please avoid any usage of System.out.println in the program.


Create class PizzaKing with below outline:
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.
Before exiting this method in any case, a result should be returned.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy