Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * McDonalds is a fast food with limited service restaurant
- *
- * @author Kamal Poudel
- * @version 1.02
- */
- /**
- * Creating Class McDonalds
- * {@inheritDoc}
- * In this class, it inherits from parent class Resturant
- */
- public class McDonalds extends Restaurant
- { /**
- *
- *instance Variables changes to global Variables
- */
- boolean hasPlayPlace=true;
- @Override
- public void Name()
- {
- System.out.println("Name of the Resturant");
- System.out.println("---------------------");
- System.out.println("McDonald's");
- }
- /**
- * Method to restore total Price including 6% tax
- * Method to show menu items
- * Method to display Location of Restaurant
- * Method to display if the resturant has play place or not
- */
- public void totalPrice()
- {
- float bill,total,tax;
- bill=2650;
- tax= (6/100f);
- total= bill+(bill*tax);
- System.out.println("Your Total Bill is: "+total);
- }
- public void menuItems()
- {
- System.out.println("McDouble\nGrilled Chicken Deluxe\nFrench Fries\nSandwiches\nMcDonald's apple pies\nMcRib\nMcDonald's Fries");
- }
- public void nameLocation()
- {
- System.out.println("Durbarmargh, Kathmandu");
- }
- public void hasPlayPlace()
- {
- if(hasPlayPlace==true)
- {
- System.out.println("Yes, we do have only indoor play palce");
- }
- else
- {
- System.out.println("Sorry, we do not have play place currently as it is renovating ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement