Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *
- *
- *
- *
- *
- *
- *
- *
- */
- namespace PracticeProgram
- {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using PracticeProgram;
- public class StockPrice
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="args"></param>
- static void Main(string[] args)
- {
- try
- {
- PortfolioStock.putStockFile(@"C:/Users/vinothkanth/Documents/Visual Studio 2013/Projects/PracticeProgram-I/test.txt");
- double[] stockResult = PortfolioStock.fetchSumOfSingleLine();
- string[] singleLine = PortfolioStock.fetchSingleLine();
- Dictionary<string, double> dict = new Dictionary<string, double>();
- for (int stockCount = 0; stockCount < stockResult.Length; stockCount++)
- {
- dict.Add(singleLine[stockCount], stockResult[stockCount]);
- }
- var items = from pair in dict orderby pair.Value descending select pair;
- foreach (KeyValuePair<string, double> pair in items)
- {
- Console.WriteLine("Stock Rate ( {0} )\t => For [ {1} ]", pair.Value, pair.Key);
- }
- Console.ReadKey();
- }
- catch (Exception fileNotFount)
- {
- Console.WriteLine(fileNotFount);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment