American GPA Calculator

By zexx0r on Feb 10, 2009

Basically,

you would have to modify some of the subject names,
because the subjects in the code are mine, and you probably don't have the same ones ;)

after modifying, you start the code with /calc.gpa
you click the grade you have, and every field will be filled out.
when you fill all of em up, you click DO THE MATH button,
and it will calculate your grade point average :)

; ----------------------------
; american gpa calculator
; personal usage version 1.0.2
; ----------------------------
; created by nikola jovanovic
; alias zexx0r
; ----------------------------

; loading

on *:load: {
  if ( $version < 6.21 ) { $update.window() }
  else { $ok.window() }
}

; unloading

on *:unload: { $tnx.window() }

; aliases

alias calc.gpa { dialog -m gpa.master gpa.master }
alias ok.window { dialog -m ok.window ok.window }
alias update.window { dialog -m update.window update.window }
alias tnx.window { dialog -m tnx.window tnx.window }

; sub dialog 1

dialog update.window {
  title "Version Checker"
  size -1 -1 151 77
  option dbu
  box "", 1, 3 7 146 58
  text "Copyright (c) 2009 by zexx0r", 2, 42 66 71 8, center
  text "This version of mIRC client is not supported.", 3, 24 19 106 8, center
  text "Please download version greater or equal to 6.21", 4, 17 28 119 8, center
  text "Thank you!", 5, 67 37 27 8, center
  button "OK", 6, 57 49 46 10, default
}

; sub dialog 2

dialog ok.window {
  title "Version Checker"
  size -1 -1 151 77
  option dbu
  box "", 1, 3 7 146 58
  text "Copyright (c) 2009 by zexx0r", 2, 42 66 71 8, center
  text "The version has been checked.", 3, 41 19 75 8, center
  text "You may proceed using this addon", 4, 37 28 82 8, center
  text "Thank you!", 5, 67 37 27 8, center
  button "OK", 6, 57 49 46 10, default
}

; sub dialog 3

dialog tnx.window {
  title "Addon Successfully Removed"
  size -1 -1 151 72
  option dbu
  box "", 1, 3 7 146 50
  text "Copyright (c) 2009 by zexx0r", 2, 42 60 71 8, center
  text "Thank you for using the addon!", 3, 41 19 76 8, center
  text "Please recommend it to the others if you liked it!", 4, 21 28 116 8, center
  button "OK", 6, 54 42 46 10, default
}
; main dialog

dialog gpa.master {
  title "GPA Calculator - version 1.0.2 - coded by zexx0r"
  size -1 -1 287 166
  option dbu
  text "Copyright (c) 2009 by zexx0r", 2, 108 156 73 8, center
  text "Debate and Broadcasting", 3, 13 27 61 8, center
  text "Computer Applications", 4, 16 39 54 8, center
  text "Economics", 5, 30 51 25 8, center
  text "Web Page Design 2", 6, 20 63 47 8, center
  text "Advanced Weightlifting", 7, 16 75 56 8, center
  text "Geometry 2B", 8, 26 87 31 8, center
  text "Hippie History", 9, 25 99 33 8, center
  text "World Religions", 10, 23 111 37 8, center
  edit %1.grade.first, 11, 82 25 18 10, limit 2
  edit %2.grade.second, 12, 82 37 18 10, limit 2
  edit %3.grade.third, 13, 82 49 18 10, limit 2
  edit %4.grade.fourth, 14, 82 62 18 10, limit 2
  edit %5.grade.fifth, 15, 82 74 18 10, limit 2
  edit %6.grade.sixth, 16, 82 86 18 10, limit 2
  edit %7.grade.seventh, 17, 82 98 18 10, limit 2
  edit %8.grade.eighth, 18, 82 110 18 10, limit 2
  button "A+", 19, 110 22 22 18, default
  button "A", 20, 135 22 22 18, default
  button "A-", 21, 160 22 22 18, default
  button "B+", 22, 110 43 22 18, default
  button "B", 23, 135 43 22 18, default
  button "B-", 24, 160 43 22 18, default
  button "C+", 25, 110 64 22 18, default
  button "C", 26, 135 64 22 18, default
  button "C-", 27, 160 64 22 18, default
  button "D+", 28, 110 85 22 18, default
  button "D", 29, 135 85 22 18, default
  button "D-", 30, 160 85 22 18, default
  button "F", 31, 135 106 22 18, default
  text "Just press the magic button", 33, 199 39 67 8, center
  button "Do the math", 34, 201 54 62 18, default
  box "", 32, 192 23 82 90
  box "", 1, 3 8 282 146
  edit "", 35, 204 79 58 10
  edit "", 36, 204 93 58 10
  button "Close", 37, 120 135 54 10, default
}

; grade calculation formula

alias doTheMath1 {
  if ( A+ == %1.grade.first ) { set %1.subject.first 4.333 }
  if ( A == %1.grade.first ) { set %1.subject.first 4.000 }
  if ( A- == %1.grade.first ) { set %1.subject.first 3.667 }
  if ( B+ == %1.grade.first ) { set %1.subject.first 3.333 }
  if ( B == %1.grade.first ) { set %1.subject.first 3.000 }
  if ( B- == %1.grade.first ) { set %1.subject.first 2.667 }
  if ( C+ == %1.grade.first ) { set %1.subject.first 2.333 }
  if ( C == %1.grade.first ) { set %1.subject.first 2.000 }
  if ( C- == %1.grade.first ) { set %1.subject.first 1.667 }
  if ( D+ == %1.grade.first ) { set %1.subject.first 1.333 }
  if ( D == %1.grade.first ) { set %1.subject.first 1.000 }
  if ( D- == %1.grade.first ) { set %1.subject.first 0.667 }
  if ( A+ == %2.grade.second ) { set %2.subject.second 4.333 }
  if ( A == %2.grade.second ) { set %2.subject.second 4.000 }
  if ( A- == %2.grade.second ) { set %2.subject.second 3.667 }
  if ( B+ == %2.grade.second ) { set %2.subject.second 3.333 }
  if ( B == %2.grade.second ) { set %2.subject.second 3.000 }
  if ( B- == %2.grade.second ) { set %2.subject.second 2.667 }
  if ( C+ == %2.grade.second ) { set %2.subject.second 2.333 }
  if ( C == %2.grade.second ) { set %2.subject.second 2.000 }
  if ( C- == %2.grade.second ) { set %2.subject.second 1.667 }
  if ( D+ == %2.grade.second ) { set %2.subject.second 1.333 }
  if ( D == %2.grade.second ) { set %2.subject.second 1.000 }
  if ( D- == %2.grade.second ) { set %2.subject.second 0.667 }
  if ( A+ == %3.grade.third ) { set %3.subject.third 4.333 }
  if ( A == %3.grade.third ) { set %3.subject.third 4.000 }
  if ( A- == %3.grade.third ) { set %3.subject.third 3.667 }
  if ( B+ == %3.grade.third ) { set %3.subject.third 3.333 }
  if ( B == %3.grade.third ) { set %3.subject.third 3.000 }
  if ( B- == %3.grade.third ) { set %3.subject.third 2.667 }
  if ( C+ == %3.grade.third ) { set %3.subject.third 2.333 }
  if ( C == %3.grade.third ) { set %3.subject.third 2.000 }
  if ( C- == %3.grade.third ) { set %3.subject.third 1.667 }
  if ( D+ == %3.grade.third ) { set %3.subject.third 1.333 }
  if ( D == %3.grade.third ) { set %3.subject.third 1.000 }
  if ( D- == %3.grade.third ) { set %3.subject.third 0.667 }
  if ( A+ == %4.grade.fourth ) { set %4.subject.fourth 4.333 }
  if ( A == %4.grade.fourth ) { set %4.subject.fourth 4.000 }
  if ( A- == %4.grade.fourth ) { set %4.subject.fourth 3.667 }
  if ( B+ == %4.grade.fourth ) { set %4.subject.fourth 3.333 }
  if ( B == %4.grade.fourth ) { set %4.subject.fourth 3.000 }
  if ( B- == %4.grade.fourth ) { set %4.subject.fourth 2.667 }
  if ( C+ == %4.grade.fourth ) { set %4.subject.fourth 2.333 }
  if ( C == %4.grade.fourth ) { set %4.subject.fourth 2.000 }
  if ( C- == %4.grade.fourth ) { set %4.subject.fourth 1.667 }
  if ( D+ == %4.grade.fourth ) { set %4.subject.fourth 1.333 }
  if ( D == %4.grade.fourth ) { set %4.subject.fourth 1.000 }
  if ( D- == %4.grade.fourth ) { set %4.subject.fourth 0.667 }
  if ( A+ == %5.grade.fifth ) { set %5.subject.fifth 4.333 }
  if ( A == %5.grade.fifth ) { set %5.subject.fifth 4.000 }
  if ( A- == %5.grade.fifth ) { set %5.subject.fifth 3.667 }
  if ( B+ == %5.grade.fifth ) { set %5.subject.fifth 3.333 }
  if ( B == %5.grade.fifth ) { set %5.subject.fifth 3.000 }
  if ( B- == %5.grade.fifth ) { set %5.subject.fifth 2.667 }
  if ( C+ == %5.grade.fifth ) { set %5.subject.fifth 2.333 }
  if ( C == %5.grade.fifth ) { set %5.subject.fifth 2.000 }
  if ( C- == %5.grade.fifth ) { set %5.subject.fifth 1.667 }
  if ( D+ == %5.grade.fifth ) { set %5.subject.fifth 1.333 }
  if ( D == %5.grade.fifth ) { set %5.subject.fifth 1.000 }
  if ( D- == %5.grade.fifth ) { set %5.subject.fifth 0.667 }
  if ( A+ == %6.grade.sixth ) { set %6.subject.sixth 4.333 }
  if ( A == %6.grade.sixth ) { set %6.subject.sixth 4.000 }
  if ( A- == %6.grade.sixth ) { set %6.subject.sixth 3.667 }
  if ( B+ == %6.grade.sixth ) { set %6.subject.sixth 3.333 }
  if ( B == %6.grade.sixth ) { set %6.subject.sixth 3.000 }
  if ( B- == %6.grade.sixth ) { set %6.subject.sixth 2.667 }
  if ( C+ == %6.grade.sixth ) { set %6.subject.sixth 2.333 }
  if ( C == %6.grade.sixth ) { set %6.subject.sixth 2.000 }
  if ( C- == %6.grade.sixth ) { set %6.subject.sixth 1.667 }
  if ( D+ == %6.grade.sixth ) { set %6.subject.sixth 1.333 }
  if ( D == %6.grade.sixth ) { set %6.subject.sixth 1.000 }
  if ( D- == %6.grade.sixth ) { set %6.subject.sixth 0.667 }
  if ( A+ == %7.grade.seventh ) { set %7.subject.seventh 4.333 }
  if ( A == %7.grade.seventh ) { set %7.subject.seventh 4.000 }
  if ( A- == %7.grade.seventh ) { set %7.subject.seventh 3.667 }
  if ( B+ == %7.grade.seventh ) { set %7.subject.seventh 3.333 }
  if ( B == %7.grade.seventh ) { set %7.subject.seventh 3.000 }
  if ( B- == %7.grade.seventh ) { set %7.subject.seventh 2.667 }
  if ( C+ == %7.grade.seventh ) { set %7.subject.seventh 2.333 }
  if ( C == %7.grade.seventh ) { set %7.subject.seventh 2.000 }
  if ( C- == %7.grade.seventh ) { set %7.subject.seventh 1.667 }
  if ( D+ == %7.grade.seventh ) { set %7.subject.seventh 1.333 }
  if ( D == %7.grade.seventh ) { set %7.subject.seventh 1.000 }
  if ( D- == %7.grade.seventh ) { set %7.subject.seventh 0.667 }
  if ( A+ == %8.grade.eighth ) { set %8.subject.eighth 4.333 }
  if ( A == %8.grade.eighth ) { set %8.subject.eighth 4.000 }
  if ( A- == %8.grade.eighth ) { set %8.subject.eighth 3.667 }
  if ( B+ == %8.grade.eighth ) { set %8.subject.eighth 3.333 }
  if ( B == %8.grade.eighth ) { set %8.subject.eighth 3.000 }
  if ( B- == %8.grade.eighth ) { set %8.subject.eighth 2.667 }
  if ( C+ == %8.grade.eighth ) { set %8.subject.eighth 2.333 }
  if ( C == %8.grade.eighth ) { set %8.subject.eighth 2.000 }
  if ( C- == %8.grade.eighth ) { set %8.subject.eighth 1.667 }
  if ( D+ == %8.grade.eighth ) { set %8.subject.eighth 1.333 }
  if ( D == %8.grade.eighth ) { set %8.subject.eighth 1.000 }
  if ( D- == %8.grade.eighth ) { set %8.subject.eighth 0.667 }
}

alias doTheMath2 {
  if ( %gpa.avg == 0.000 ) || ( %gpa.avg < 0.667 ) { did -a gpa.master 36 F }
  if ( %gpa.avg >= 0.667 ) && ( %gpa.avg < 1.000 ) { did -a gpa.master 36 D- }
  if ( %gpa.avg >= 1.000 ) && ( %gpa.avg < 1.333 ) { did -a gpa.master 36 D }
  if ( %gpa.avg >= 1.333 ) && ( %gpa.avg < 1.667 ) { did -a gpa.master 36 D }
  if ( %gpa.avg >= 1.667 ) && ( %gpa.avg < 2.000 ) { did -a gpa.master 36 C- }
  if ( %gpa.avg >= 2.000 ) && ( %gpa.avg < 2.333 ) { did -a gpa.master 36 C }
  if ( %gpa.avg >= 2.333 ) && ( %gpa.avg < 2.667 ) { did -a gpa.master 36 C+ }
  if ( %gpa.avg >= 2.667 ) && ( %gpa.avg < 3.000 ) { did -a gpa.master 36 B- }
  if ( %gpa.avg >= 3.000 ) && ( %gpa.avg < 3.333 ) { did -a gpa.master 36 B }
  if ( %gpa.avg >= 3.333 ) && ( %gpa.avg < 3.667 ) { did -a gpa.master 36 B+ }
  if ( %gpa.avg >= 3.667 ) && ( %gpa.avg < 4.000 ) { did -a gpa.master 36 A- }
  if ( %gpa.avg >= 4.000 ) && ( %gpa.avg < 4.333 ) { did -a gpa.master 36 A }
  if ( %gpa.avg == 4.333 ) { did -a gpa.master 36 A+ }
}

; dialog events

on *:dialog:gpa.master:*:*: {
  if ( $devent == sclick ) {
    if ( $did == 19 ) {
      if (!%1.grade.first) { set %1.grade.first $did(19) | did -a gpa.master 11 $did(19) }
      elseif (!%2.grade.second) { set %2.grade.second $did(19) | did -a gpa.master 12 $did(19) }
      elseif (!%3.grade.third) { set %3.grade.third $did(19) | did -a gpa.master 13 $did(19) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(19) | did -a gpa.master 14 $did(19) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(19) | did -a gpa.master 15 $did(19) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(19) | did -a gpa.master 16 $did(19) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(19) | did -a gpa.master 17 $did(19) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(19) | did -a gpa.master 18 $did(19) }
    }
    if ( $did == 20 ) {
      if (!%1.grade.first) { set %1.grade.first $did(20) | did -a gpa.master 11 $did(20) }
      elseif (!%2.grade.second) { set %2.grade.second $did(20) | did -a gpa.master 12 $did(20) }
      elseif (!%3.grade.third) { set %3.grade.third $did(20) | did -a gpa.master 13 $did(20) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(20) | did -a gpa.master 14 $did(20) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(20) | did -a gpa.master 15 $did(20) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(20) | did -a gpa.master 16 $did(20) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(20) | did -a gpa.master 17 $did(20) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(20) | did -a gpa.master 18 $did(20) }
    }
    if ( $did == 21 ) {
      if (!%1.grade.first) { set %1.grade.first $did(21) | did -a gpa.master 11 $did(21) }
      elseif (!%2.grade.second) { set %2.grade.second $did(21) | did -a gpa.master 12 $did(21) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(21) | did -a gpa.master 13 $did(21) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(21) | did -a gpa.master 14 $did(21) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(21) | did -a gpa.master 15 $did(21) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(21) | did -a gpa.master 16 $did(21) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(21) | did -a gpa.master 17 $did(21) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(21) | did -a gpa.master 18 $did(21) }
    }
    if ( $did == 22 ) {
      if (!%1.grade.first) { set %1.grade.first $did(22) | did -a gpa.master 11 $did(22) }
      elseif (!%2.grade.second) { set %2.grade.second $did(22) | did -a gpa.master 12 $did(22) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(22) | did -a gpa.master 13 $did(22) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(22) | did -a gpa.master 14 $did(22) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(22) | did -a gpa.master 15 $did(22) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(22) | did -a gpa.master 16 $did(22) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(22) | did -a gpa.master 17 $did(22) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(22) | did -a gpa.master 18 $did(22) }
    }
    if ( $did == 23 ) {
      if (!%1.grade.first) { set %1.grade.first $did(23) | did -a gpa.master 11 $did(23) }
      elseif (!%2.grade.second) { set %2.grade.second $did(23) | did -a gpa.master 12 $did(23) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(23) | did -a gpa.master 13 $did(23) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(23) | did -a gpa.master 14 $did(23) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(23) | did -a gpa.master 15 $did(23) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(23) | did -a gpa.master 16 $did(23) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(23) | did -a gpa.master 17 $did(23) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(23) | did -a gpa.master 18 $did(23) }
    }
    if ( $did == 24 ) {
      if (!%1.grade.first) { set %1.grade.first $did(24) | did -a gpa.master 11 $did(24) }
      elseif (!%2.grade.second) { set %2.grade.second $did(24) | did -a gpa.master 12 $did(24) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(24) | did -a gpa.master 13 $did(24) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(24) | did -a gpa.master 14 $did(24) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(24) | did -a gpa.master 15 $did(24) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(24) | did -a gpa.master 16 $did(24) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(24) | did -a gpa.master 17 $did(24) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(24) | did -a gpa.master 18 $did(24) }
    }
    if ( $did == 25 ) {
      if (!%1.grade.first) { set %1.grade.first $did(25) | did -a gpa.master 11 $did(25) }
      elseif (!%2.grade.second) { set %2.grade.second $did(25) | did -a gpa.master 12 $did(25) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(25) | did -a gpa.master 13 $did(25) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(25) | did -a gpa.master 14 $did(25) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(25) | did -a gpa.master 15 $did(25) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(25) | did -a gpa.master 16 $did(25) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(25) | did -a gpa.master 17 $did(25) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(25) | did -a gpa.master 18 $did(25) }
    }
    if ( $did == 26 ) {
      if (!%1.grade.first) { set %1.grade.first $did(26) | did -a gpa.master 11 $did(26) }
      elseif (!%2.grade.second) { set %2.grade.second $did(26) | did -a gpa.master 12 $did(26) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(26) | did -a gpa.master 13 $did(26) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(26) | did -a gpa.master 14 $did(26) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(26) | did -a gpa.master 15 $did(26) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(26) | did -a gpa.master 16 $did(26) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(26) | did -a gpa.master 17 $did(26) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(26) | did -a gpa.master 18 $did(26) }
    }
    if ( $did == 27 ) {
      if (!%1.grade.first) { set %1.grade.first $did(27) | did -a gpa.master 11 $did(27) }
      elseif (!%2.grade.second) { set %2.grade.second $did(27) | did -a gpa.master 12 $did(27) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(27) | did -a gpa.master 13 $did(27) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(27) | did -a gpa.master 14 $did(27) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(27) | did -a gpa.master 15 $did(27) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(27) | did -a gpa.master 16 $did(27) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(27) | did -a gpa.master 17 $did(27) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(27) | did -a gpa.master 18 $did(27) }
    }
    if ( $did == 28 ) {
      if (!%1.grade.first) { set %1.grade.first $did(28) | did -a gpa.master 11 $did(28) }
      elseif (!%2.grade.second) { set %2.grade.second $did(28) | did -a gpa.master 12 $did(28) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(28) | did -a gpa.master 13 $did(28) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(28) | did -a gpa.master 14 $did(28) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(28) | did -a gpa.master 15 $did(28) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(28) | did -a gpa.master 16 $did(28) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(28) | did -a gpa.master 17 $did(28) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(28) | did -a gpa.master 18 $did(28) }
    }
    if ( $did == 29 ) {
      if (!%1.grade.first) { set %1.grade.first $did(29) | did -a gpa.master 11 $did(29) }
      elseif (!%2.grade.second) { set %2.grade.second $did(29) | did -a gpa.master 12 $did(29) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(29) | did -a gpa.master 13 $did(29) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(29) | did -a gpa.master 14 $did(29) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(29) | did -a gpa.master 15 $did(29) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(29) | did -a gpa.master 16 $did(29) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(29) | did -a gpa.master 17 $did(29) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(29) | did -a gpa.master 18 $did(29) }
    }
    if ( $did == 30 ) {
      if (!%1.grade.first) { set %1.grade.first $did(30) | did -a gpa.master 11 $did(30) }
      elseif (!%2.grade.second) { set %2.grade.second $did(30) | did -a gpa.master 12 $did(30) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(30) | did -a gpa.master 13 $did(30) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(30) | did -a gpa.master 14 $did(30) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(30) | did -a gpa.master 15 $did(30) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(30) | did -a gpa.master 16 $did(30) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(30) | did -a gpa.master 17 $did(30) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(30) | did -a gpa.master 18 $did(30) }
    }
    if ( $did == 31 ) {
      if (!%1.grade.first) { set %1.grade.first $did(31) | did -a gpa.master 11 $did(31) }
      elseif (!%2.grade.second) { set %2.grade.second $did(31) | did -a gpa.master 12 $did(31) }
      elseif (!%3.grade.third ) { set %3.grade.third $did(31) | did -a gpa.master 13 $did(31) }
      elseif (!%4.grade.fourth) { set %4.grade.fourth $did(31) | did -a gpa.master 14 $did(31) }
      elseif (!%5.grade.fifth) { set %5.grade.fifth $did(31) | did -a gpa.master 15 $did(31) }
      elseif (!%6.grade.sixth) { set %6.grade.sixth $did(31) | did -a gpa.master 16 $did(31) }
      elseif (!%7.grade.seventh) { set %7.grade.seventh $did(31) | did -a gpa.master 17 $did(31) }
      elseif (!%8.grade.eighth) { set %8.grade.eighth $did(31) | did -a gpa.master 18 $did(31) }
    }
    if ( $did == 34 ) {
      $doTheMath()
      set %gpa.result $calc(%1.subject.first + %2.subject.second + %3.subject.third + %4.subject.fourth + %5.subject.fifth + %6.subject.sixth + %7.subject.seventh + %8.subject.eighth)
      set %gpa.avg $calc(%gpa.result / 8)
      did -a gpa.master 35 %gpa.avg
      $doTheMath2()
    }
    if ( $did == 37 ) { 
      dialog -x gpa.master gpa.master
      unset %*.subject.*
      unset %*.grade.*
      unset %gpa.*
    }
  }
}

Comments

Sign in to comment.
Aucun50   -  Feb 10, 2009

I like, could be shortened a lot but ill let napa handle that :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.