class Stock Name InitializeValue (stockPrice) maxChange (stockPriceChange) threshold (the value nearest to measure the change of te stock for raising an event.) Stock (name/startingValue, maxChange, threshold) { currentValue = startingValue; notification Threshold = threshold; thread = new Thread (new ThreadStart(Activate)); public void Activate() { for(;;){ Thread.sleep(500); ChangeStockValue(); } } ChangeStockValue() { currentValue += random between 1 and maxChange numberChanges++; if(currentValue - initialValue) > notificationThreshold { Raise the event create event data(e); OnStockChangeReached(e); } } class Broker { brokerName Liststocks; addStock(Stock s) { add a stock to the list s.notification += BrokerEventHandler (send stock info to he console window) s.notification += FileEventHandler(toFile)