thanks a lot for the reply.. i really understood the user defined function concept now.. i have another question though if you could please help.
my data.txt now looks like
1 2 3 4 5 6
|
30 50 10 60
4
S11111111 30 50 10 60
S22222222 0 0 0 0
S33333333 15 10 5 30
S44444444 18 35 9 22
|
The first column contains the student id.
The second column contains the mid-semester exam mark
The third column contains the Project Mark
The forth column contains the Quiz mark
The fifth column contains the final exam mark
The first row contains the maximum attainable mark for each assessment (Mid-test mark, Project
mark, Quiz mark and Final exam mark) respectively
The second row of the data file contains the number of student records in the file. For instance, in this case, 4 will mean that there are four students in the class and four student details in the data file.
the formula for calculating total is given as
Tot = Mid-test / Mid-test_max * 15 + Project / Project_max * 20 +
Quiz / Quiz_max * 5 + Final_exam / Final_exam_max * 60
the max mark for each test can be edited by the lecturer at any time. therefore it is not constant.
my question is that for eg. i know 4 indicates the amount of rows of data.. but while calculating the total how to make ur array know that the first row ONLY is the max amount of marks for each test.. as it falls under the same column as the id no. , mid test mark, quiz mark etc.. it gets mixed up..