nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

Week 9 Quiz Question 25 #411

Closed XylusChen closed 1 year ago

XylusChen commented 1 year ago

Hi everyone! Here is a screenshot of the question:

image

In the textbook it says that "Exactly one of the guard conditions should be true at any given branch node". So my question is for this given scenario, what if it's neither high nor low? Or do we give the question the benefit of the doubt and just assume it can only be high or low?

ARPspoofing commented 1 year ago

Hmm I guess we have to assume that it is calculated correctly (i.e there is no overlapping between high and low). But I feel that in this case it is intuitive that if it is not high, then it will low.

damithc commented 1 year ago

Hmm I guess we have to assume that it is calculated correctly (i.e there is no overlapping between high and low). But I feel that in this case it is intuitive that if it is not high, then it will low.

@ARPspoofing Yes, that is a reasonable assumption when doing a question like this. Caveats:

  1. In the exam, remember to state such assumptions.
  2. In real projects, it is best not to make such assumptions. For example, there can be a third option medium that is not shown in the diagram. So, it is best to verify all such assumptions before taking actions based on them.
XylusChen commented 1 year ago

Thank you @ARPspoofing and Prof Damith @damithc! 👍