Re: greater than AND less than
Re: greater than AND less than
- Subject: Re: greater than AND less than
- From: Ed Stockly <email@hidden>
- Date: Sun, 26 Aug 2001 12:44:53 -0700
You might also try this...
set gradeRangeList to {,
{96.5, 100, "A+"}, {92.5, 96.45, "A"}, {89.5, 92.45, "A-"}, ,
{86.5, 89.45, "B+"}, {82.5, 86.45, "B"}, {79.5, 82.45, "B-"}, ,
{76.5, 79.45, "C+"}, {72.5, 76.45, "C"}, {69.5, 72.45, "C-"}, ,
{64.5, 69.45, "D"}, {0, 64.45, "F"}}
repeat with i from 1 to 11
set gradeRange to item i of gradeRangeList
if finalAverage is greater than or equal to item 1 of gradeRange and
finalAverage is less than or equal to item 2 of gradeRange then
set theGrade to item 3 of gradeRange
exit repeat
end if
end repeat
You could also easily expand it to include:
{96.5, 100, "A+", 4.0}, {92.5, 96.45, "A",4.0}{89.5, 92.45, "A-",4.0}, ,
{86.5, 89.45, "B+",3.0} etc.
-- <
http://justapplescript.weblogs.com/>
-- <
http://justapplescript.weblogs.com/AppleScriptLearningResources>
-- Feedback welcome, join today!