Question
create an application which contains the following: A class called StockPrice. This class needs to be able to store the name of a stock (stock
create an application which contains the following:
A class called StockPrice. This class needs to be able to store the name of a stock (stock as in JSE / DOW Jones / FTSE / NY Stock Exchange) and its price. It should also provide an override of the ToString() which returns the stocks name and price.
A class called StockTicker. This class needs to keep track of a list of StockPrices. Whenever a new item is added to the list, an item is removed or a price is updated, the entire stock list must be automatically passed to the following class: o StockDisplay: When created, it should display the entire list of StockPrices to the console window. Every time the list of StockPrices is updated, it should only display the information related to the StockPrice that has changed (i.e. not the entire list). The program should continuously loop until the user presses the e-key to end the program. At each iteration of the loop the screen should be cleared and a menu displayed to the user. The menu should allow the following options (with associated functionality): o (a)dd a new stock o (u)pdate an existing stock o (r)emove an existing stock o (e)nd the program
The program should be based on the observer pattern using C# events, which means it should include all of the interfaces and methods required to align to this pattern, while making use of C# events.
language is C#
please note
interfaces(can be any abstract super type not necessarily java interface). All observers who need the data need to implement observer interface. notify() method in observer interface defines the action to be taken when the subject provides it data.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started