General discussion

  • Creator
    Topic
  • #2313858

    If, Then, Else Statement

    Locked

    by petadove ·

    I am writing a program to calculate student grades. Students receive bonus points for Extra credit work and they also receive penalty for late submission of work.

    my statement goes something like
    if radxxxxxx.visble = true then txtxxxxxxx.value- numxxxxx.value + 5 (or minus) depending on the radio button I am working with.

    I am not sure if anyone can give me assistance based on this scenario but if someone can I’d be grateful.

All Comments

  • Author
    Replies
    • #3458737

      If, Then, Else Statement

      by john_wills ·

      In reply to If, Then, Else Statement

      The question? The problem? The definition of what is required?

    • #3534460

      If, Then, Else Statement

      by amanabala ·

      In reply to If, Then, Else Statement

      Hello,

      I am assuming that there are a set of radio buttons, corresponding text boxes(2 sets).
      If you put the radio buttons and the text boxes in arrays (depending on the programming language, how you achieve this will change).
      When you use arrays, your statement will look like
      in VB
      indx = rad.selectedIndex
      if indx = 1 then ‘ Extra credit
      extra=5
      else if indx=2 then
      extra =-5
      end if

      grade = txt(indx)-num1(indx)+extra

      wher your radio button array is called rad,
      txt is the name of the text box array and num1 is the name of the values array

      If you can give me more specifics, may be I can give a detailed answer.

      regards,
      Ravi
      ananth_manabala@yahoo.com

    • #3539108

      If, Then, Else Statement

      by petadove ·

      In reply to If, Then, Else Statement

      This question was closed by the author

Viewing 2 reply threads