-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathOurStoreApp2.cs
34 lines (29 loc) · 1 KB
/
OurStoreApp2.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
Create the OurStore Class Diagram and a Demo App
*/
using System;
namespace OurStore;
public class OurStoreApp2
{
public static void Main(string[] args)
{
Customers customers = new Customers();
customers.Add("mjordan@nba.com", "Michael Jordan", "Los Angeles");
customers.Add("spipens@nba.com", "Scotch Pipens", "San Diego");
customers.Add("ljames@nba.com", "Lebron James", "San Francisco");
Products prodcuts = new Products();
prodcuts.Add(1, "Basketball", 250);
prodcuts.Add(2, "Bull's TShirt", 450);
prodcuts.Add(3, "Water bottle", 45);
Customer customer = customers.FindByEmail("mjordan@nba.com");
Console.WriteLine(customer);
Order order = customer.AddOrder();
order.AddProduct(prodcuts.FindById(3), 30);
order.AddProduct(prodcuts.FindById(1), 5);
order.AddProduct(prodcuts.FindById(2), 15);
Console.WriteLine($"Order Total: {order.Total}");
customer.PrintOrders();
order.UpdateStatus(OrderStatus.Completed);
customer.PrintOrders();
}
}