I got to this far. done with converting and everything. Now down to the other step. I want to calculate the total payments for all the employee has the same years of experiences. FOr example: 5 guys with 10 year experiences, get pay at 90k/year. I want to show all the ID of these guy with years of experiences and total payments that company pays to them.
string[] results;
char[] delimiter1 = new char[] { ',' };
FileStream fStream = new FileStream("C:\\test1.txt", FileMode.Open, FileAccess.Read);
StreamReader inFile = new StreamReader(fStream);
string inputLine;
inputLine = inFile.ReadLine();
while (!inFile.EndOfStream)
{
inputLine = inFile.ReadLine();
results = inputLine.Split(delimiter1, StringSplitOptions.RemoveEmptyEntries);
string[] strings = results;
int[] intInput = new int[strings.Length];
for (int i = 0; i < strings.Length; i++)
{
Int32.TryParse(strings[i], out intInput[i]);
}
string empID = strings[0];
int empClass = intInput[1];
int empRate = intInput[2];
double[] totalPoints = new double[30];
if (empClass >= 1 && empClass <= 30)
{
totalPayments[empClass - 1] = totalPayments[empClass - 1] + empRate;
Console.WriteLine("{0,-20} {1,-20}", empID, totalPayments[empClass - 1]);
}
else
{
Console.WriteLine("invalid years of experience");