fishbone34
09-27-2004, 11:14 PM
Hello, I Have a caculation within a script that outputs a Number between 10 to 100 based on table data. Here is the caculation code:
HERE it is:
'Calculate Total Score
faceSubScore = (CInt(tablearray(7,0)) + CInt(tablearray(9,0)) + CInt(tablearray(11,0)) + CInt(tablearray(13,0)) + CInt(tablearray(15,0)) + CInt(tablearray(17,0)) + CInt(tablearray(19,0)) + CInt(tablearray(21,0)))
'response.write("faceSubScore: " &faceSubScore&"<br>")
CommSubScore = (CInt(tablearray(23,0))+CInt(tablearray(25,0))+CInt(tablearray(27,0))+CInt(tablearray(29,0))+CInt(ta blearray(31,0)))
'response.write("CommSubScore: " &CommSubScore&"<br>")
totalScore = (faceSubScore)+(CommSubScore)
totalScore = round(totalScore,2)
'response.write("Total Score: "&totalScore&"<br>")
The Code above spits out the Total Score anywhere from 10 to 100. I would like to write something that would output the Totalscore, based on a scale, to numbers between 1 - 5.
Example: the total score = 92
The Scale:
100 = 5
90 - 99 = 4
80 - 89 = 3
70 -79 = 2
69 or LESS = 1
The Total Score will be = 4
Is this Possible?
Chris
chris@thesouthside.net
HERE it is:
'Calculate Total Score
faceSubScore = (CInt(tablearray(7,0)) + CInt(tablearray(9,0)) + CInt(tablearray(11,0)) + CInt(tablearray(13,0)) + CInt(tablearray(15,0)) + CInt(tablearray(17,0)) + CInt(tablearray(19,0)) + CInt(tablearray(21,0)))
'response.write("faceSubScore: " &faceSubScore&"<br>")
CommSubScore = (CInt(tablearray(23,0))+CInt(tablearray(25,0))+CInt(tablearray(27,0))+CInt(tablearray(29,0))+CInt(ta blearray(31,0)))
'response.write("CommSubScore: " &CommSubScore&"<br>")
totalScore = (faceSubScore)+(CommSubScore)
totalScore = round(totalScore,2)
'response.write("Total Score: "&totalScore&"<br>")
The Code above spits out the Total Score anywhere from 10 to 100. I would like to write something that would output the Totalscore, based on a scale, to numbers between 1 - 5.
Example: the total score = 92
The Scale:
100 = 5
90 - 99 = 4
80 - 89 = 3
70 -79 = 2
69 or LESS = 1
The Total Score will be = 4
Is this Possible?
Chris
chris@thesouthside.net