Using input files, one dimensional and two dimensional arrays
I'm really frustrated with a program that I am trying to create for my computer science class.
The program uses a one dimensional array to store names from an input file and then another two dimensional array to store the hours worked of the employees and their pay rate.
From this, I am supposed to use methods to calculate and store the gross pay, net pay, taxes, and union dues for each of the employees.
My first problem is importing my name data. I am using a StringTokenizer, which I know for a lot of programmers is very archaic. My teacher is very archaic in a lot of ways. My program code for my method to read the input file is like this looks like this:
Then I have my first method for calculation. I know this is probably really bad code, but I have no idea what I am doing.:confused: I have been combing the web trying to find something out there about taking data from other columns and calculating them into other columns with two dimensional arrays. Most sites just have the basics on two-dimensional arrays and nothing like what I have to do.
What I am trying to do is to take the hours that are stored in my 5th column of my array with the pay rate in column 6 and trying to store that in my column 1 of my array. I'm only sending the information to the screen to see if what I am doing is working.
|All times are GMT +5.5. The time now is 02:53.|