Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4.  
  5.  
  6. class Algorithms{
  7. //Create an array, find the specified file and input every line of the file into the array
  8. static string[] dates = System.IO.File.ReadAllLines(@"Date.txt");
  9. static string[] days = System.IO.File.ReadAllLines(@"Day.txt");
  10. static string[] SH1Close = System.IO.File.ReadAllLines(@"SH1_Close.txt");
  11. static string[] SH1Diff = System.IO.File.ReadAllLines(@"SH1_Diff.txt");
  12. static string[] SH1Open = System.IO.File.ReadAllLines(@"SH1_Open.txt");
  13. static string[] SH1Vol = System.IO.File.ReadAllLines(@"SH1_Volume.txt");
  14. static string[] SH2Close = System.IO.File.ReadAllLines(@"SH2_Close.txt");
  15. static string[] SH2Diff = System.IO.File.ReadAllLines(@"SH2_Diff.txt");
  16. static string[] SH2Open = System.IO.File.ReadAllLines(@"SH2_Open.txt");
  17. static string[] SH2Vol = System.IO.File.ReadAllLines(@"SH2_Volume.txt");
  18.  
  19. public static void Main(string[] args){
  20.  
  21.  
  22.  
  23. //Create array of different data types so dates can be read and sorted properly
  24. int[] iDates = new int[dates.Length];
  25. //Converts the initial arrays into the correct data types
  26. iDays = iConvert(iDates,dates);
  27. for(int i = 0; i < iDates.Length; i++){
  28. Console.WriteLine(iDates[i]);
  29. }
  30. }
  31. //Methods for converting array to appropriate data type
  32. public static int[] iConvert(int[] a, string[] b){
  33. for(int i = 0; i < a.Length; i++){
  34. int temp = Convert.ToInt32(b[i]);
  35. a[i] = temp;
  36.  
  37. }
  38. return a;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement