Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1.  
  2. /**
  3. * McDonalds is a fast food with limited service restaurant
  4. *
  5. * @author Kamal Poudel
  6. * @version 1.02
  7. */
  8.  
  9. /**
  10. * Creating Class McDonalds
  11. * {@inheritDoc}
  12. * In this class, it inherits from parent class Resturant
  13. */
  14. public class McDonalds extends Restaurant
  15.  
  16. { /**
  17. *
  18. *instance Variables changes to global Variables
  19. */
  20. boolean hasPlayPlace=true;
  21. @Override
  22. public void Name()
  23. {
  24. System.out.println("Name of the Resturant");
  25. System.out.println("---------------------");
  26. System.out.println("McDonald's");
  27.  
  28. }
  29. /**
  30. * Method to restore total Price including 6% tax
  31. * Method to show menu items
  32. * Method to display Location of Restaurant
  33. * Method to display if the resturant has play place or not
  34. */
  35. public void totalPrice()
  36. {
  37. float bill,total,tax;
  38. bill=2650;
  39. tax= (6/100f);
  40. total= bill+(bill*tax);
  41.  
  42. System.out.println("Your Total Bill is: "+total);
  43. }
  44. public void menuItems()
  45. {
  46. System.out.println("McDouble\nGrilled Chicken Deluxe\nFrench Fries\nSandwiches\nMcDonald's apple pies\nMcRib\nMcDonald's Fries");
  47. }
  48. public void nameLocation()
  49. {
  50. System.out.println("Durbarmargh, Kathmandu");
  51. }
  52. public void hasPlayPlace()
  53. {
  54. if(hasPlayPlace==true)
  55. {
  56. System.out.println("Yes, we do have only indoor play palce");
  57. }
  58. else
  59. {
  60. System.out.println("Sorry, we do not have play place currently as it is renovating ");
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement