Associativity exercise

closed account (EwCjE3v7)
Our program that distinguished between high pass, pass and fail depended on the fact the conditional operaotr is right associative. Describe how that operator would be evaluated if the operator were left associative.


 
  finalgrade = (grade > 90) ? "high pass" : (grade < 60) ? "fail" : "pass"


I do not understand what they mean by the question, could someone tell me how it would be done with right associativity and left. Thank you
Last edited on
closed account (EwCjE3v7)
Anyone
I don't get the question either, but here's my guess.

finalgrade = (grade <= 90) ? ((grade >= 60) ? "pass" : "fail") : "high pass";
Topic archived. No new replies allowed.