Advertisement
Guest User

Untitled

a guest
Apr 1st, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. public class MenuItem
  2. {
  3. public static string type { get; set; }
  4. public static string name { get; set; }
  5. public static double cost { get; set; }
  6. public MenuItem(string type,string name,double cost)
  7. {
  8. MenuItem.type = type;
  9. MenuItem.name = name;
  10. MenuItem.cost = cost;
  11. }
  12. }
  13.  
  14. public sealed partial class MainPage : Page
  15. {
  16. public MainPage()
  17. {
  18. this.InitializeComponent();
  19. MenuItem.type = "Breakfast";
  20. MenuItem.name = "Bacon and Eggs";
  21. MenuItem.cost = 5.00;
  22. }
  23.  
  24.  
  25.  
  26. private void BreakfastButton_Click(object sender, RoutedEventArgs e)
  27. {
  28.  
  29. BreakfastView.Items.Clear();
  30. MenuItem[] newItems = new MenuItem[20];
  31. newItems[0] = new MenuItem("Breakfast","Bacon and Eggs",5.00);
  32. newItems[1] = new MenuItem("Breakfast", "Pancakes", 4.25);
  33. newItems[2] = new MenuItem("Lunch", "Fruit Salad",3.00);
  34. newItems[3] = new MenuItem("Breakfast", "Oatmeal",3.00);
  35. newItems[4] = new MenuItem("Lunch", "Lemon Chicken",19.25);
  36. newItems[5] = new MenuItem("Breakfast", "Blue Berry Muffin",3.50);
  37. newItems[6] = new MenuItem("Dinner", "Salmon",23.50);
  38. newItems[7] = new MenuItem("Breakfast", "Omlette",5.00);
  39. newItems[8] = new MenuItem("Breakfast", "Waffles",4.00);
  40. newItems[9] = new MenuItem("Breakfast", "Cinnamon Roll",4.00);
  41. newItems[10] = new MenuItem("Breakfast", "Donut",2.50);
  42. newItems[11] = new MenuItem("Breakfast", "Chocolate Pancakes",4.50);
  43. newItems[12] = new MenuItem("Dinner", "Filet Mignon",34.50);
  44. newItems[13] = new MenuItem("Lunch", "Burrito", 9.00);
  45. newItems[14] = new MenuItem("Breakfast", "Cereal",3.00);
  46. newItems[15] = new MenuItem("Breakfast", "Avacado Toast",2.50);
  47. newItems[16] = new MenuItem("Dinner", "Sirloin Steak",25.45);
  48. newItems[17] = new MenuItem("Breakfast", "Steak and Eggs",8.50);
  49. newItems[18] = new MenuItem("Lunch", "Chicken Paninni",14.50);
  50. newItems[19] = new MenuItem("Dinner", "Porkchops",14.50);
  51. for (int i = 0; i < 20; i++)
  52. {
  53. if (MenuItem.type == "Breakfast")
  54. {
  55.  
  56. BreakfastView.Items.Add(newItems[i]);
  57. }
  58. else
  59. {
  60.  
  61. }
  62.  
  63. }
  64.  
  65.  
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement