Yeah yeah I know I keep asking for help but this ones a little up from before.
Basically my program reads from a .text file and places the info in a list box. It lists line1 as column 1 and line2 as column2 etc to 4 columns, then lists the next 4 lines under those columns. like so:
What I need it to do now is every 4th line starting at "hworked = sr.ReadLine" to read the numbers and add them all up. For an unknown ammount of lines.
Also after that it has to use the average and check it against the values in the list then multiply large values by the number on the column before.
Basically its a list of peoples names, hours worked, and £ per hour.
Basically my program reads from a .text file and places the info in a list box. It lists line1 as column 1 and line2 as column2 etc to 4 columns, then lists the next 4 lines under those columns. like so:
Dim employee, hrate, hworked, gross As String
Dim fmtStr As String = "{0,-15}{1,15}{2,15}{3,15}"
Dim sr As IO.StreamReader = IO.File.OpenText("payroll.TXT")
lstnumbers.Items.Clear()
Do While sr.Peek() <> -1
employee = sr.ReadLine
hrate = sr.ReadLine
hworked = sr.ReadLine
gross = sr.ReadLine
lstnumbers.Items.Add(String.Format(fmtStr, employee, hrate, hworked, gross))
Loop
sr.Close()
What I need it to do now is every 4th line starting at "hworked = sr.ReadLine" to read the numbers and add them all up. For an unknown ammount of lines.
Also after that it has to use the average and check it against the values in the list then multiply large values by the number on the column before.
Basically its a list of peoples names, hours worked, and £ per hour.