using System.Collections.Generic;
public event EventHandler PriceChanged ;
public string Symbole {get;set;}
public double Price {get;set;}
public class StockAnalyzer
static T getPrice<T>(string prompt) where T : struct, IConvertible
string price = Console.ReadLine();
return (T)Convert.ChangeType(price, typeof(T));
Console.WriteLine("Invalid input. Please enter a valid numeric value.");
List<Stock> stockList = new List<Stock>();
Console.WriteLine("Enter person details. Type '!' for the Name to stop.");
Stock Instance = new Stock();
Console.Write("Enter stock symbol:");
string symbole = Console.ReadLine();
Instance.Symbole = symbole;
Instance.Price = Math.Truncate(getPrice<double>("Enter stock initial price:\n") * 100) / 100 ;
Console.WriteLine("\nPeople Entered:");
foreach (Stock Instance in stockList)
Console.WriteLine($"Name: {Instance.Symbole}, Age: {Instance.Price}");
double thresholdPrice = Math.Truncate(getPrice<double>("Enter a threshold price to monitor for change:\n") * 100) / 100 ;
double thresholdPriceChange = Math.Truncate(getPrice<double>("Enter a threshold price change percent:\n") * 100) / 100 ;
foreach (Stock Instance in stockList)
double newPrice =Math.Truncate(getPrice<double>($"For stock with symbol {Instance.Symbole}, Please enter the new price:\n") * 100) / 100 ;