-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssn2_Program.cs
More file actions
64 lines (55 loc) · 2.99 KB
/
Copy pathAssn2_Program.cs
File metadata and controls
64 lines (55 loc) · 2.99 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
namespace Assignment_2
{
class Program
{
static void Main(string[] args)
{
Stock stockOne = new Stock("GOOG", "Google", 1.2m, 6.27m);
Stock stockTwo = new Stock("MSFT", "Microsoft", 5m, 111.2m);
Stock stockThree = new Stock("AAPL", "Apple", 6m, 222.7m);
Stock stockFour = new Stock("AMZN", "Amazon", 1.2m, 198.7m);
Stock stockFive = new Stock("Z", "Zillow", 2.4m, 207.6m);
Stock stockSix = new Stock("B", "Barnes ", 2.2m, 68.7m);
Stock stockSeven = new Stock("GOOG", "Google", 3.6m, 115.3m);
Stock stockEight = new Stock("AAPL", "Apple", 5m, 147.6m);
Stock stockNine = new Stock("GOOG", "Google", 1.2m, 6.27m);
ClientPortfolio client1 = new ClientPortfolio("Andrew", "Mountain View", "555-111-9070");
client1.StockList.AddStock(stockOne);
client1.StockList.AddStock(stockTwo);
client1.StockList.AddStock(stockThree);
client1.StockList.AddStock(stockFour);
client1.StockList.AddStock(stockNine);
Console.WriteLine("**************************Client-1 Portfolio*****************************************");
client1.StockList.Print();
Console.WriteLine("Number of shares :" + client1.StockList.Length());
Console.WriteLine("Current value of portfolio for client 1 :" + client1.GetPortfolioValue());
Console.WriteLine("Stock with most shares for client 1:" + client1.StockList.MostShares());
client1.StockList.SortByValue();
Console.WriteLine("Portfolio sorted in descending order by number of holdings for client 1:");
client1.StockList.Print();
Console.WriteLine("**************************Client-2 Portfolio*****************************************");
ClientPortfolio client2 = new ClientPortfolio("Chris", "New York", "435-111-000");
client2.StockList.AddStock(stockFive);
client2.StockList.AddStock(stockSix);
client2.StockList.AddStock(stockSeven);
client2.StockList.AddStock(stockEight);
client2.StockList.Print();
Console.WriteLine("Number of shares :" + client2.StockList.Length());
Console.WriteLine("Current value of portfolio for client 2 :" + client2.GetPortfolioValue());
Console.WriteLine("Stock with most shares for client 2 :" + client2.StockList.MostShares());
client2.StockList.SortByValue();
Console.WriteLine("Portfolio sorted in descending order by number of holdings for client 2:");
client2.StockList.Print();
client2.StockList.SortByName();
Console.WriteLine("Portfolio sorted in alphabatical order for client 2:");
client2.StockList.Print();
Console.WriteLine();
Console.WriteLine("Similarity Index for Client-1 and Clien-2 :" + client1.StockList.Similarity(client2.StockList));
Console.WriteLine("**************************Client-1,Client -2 Merged Portfolio*****************************************");
StockList mergedPortfolio = client1.StockList.MergeList(client2.StockList);
mergedPortfolio.Print();
Console.ReadLine();
}
}
}