welcome back to program logic and design in this section we'll be discussing the presidence when combining and and or operators you can combine many and and or operators in a single expression when multiple conditions must all be true use multiple ands assume that you need to achieve a score of less than an equal to 70 on each of three tests to pass a course so what we do is we declare constant Min schore to be 75 and what we do is in our comparison expression score one is greater than equal to Min score 75 score 2 is greater than equal to Min score which is 75 and score three is greater than equal to Min score is 75 so in order for us to pass the grade all three of those scores need to be greater and equal to 75 in order for you to pass if just one of those scores are false or are less than 75 then you are going to fail now what happens when only one of the multiple conditions must be true what we do is we use multiple ORS in our comparison expression so if we had to contrast the use of multiple or operators when only one of the multiple conditions are to True here in this example assume that you need to achieve a score of greater than equal to 75 on one of the three tests to pass the course so of course we decare the constant minimum score which is 75 if one of those three scores is true you're going to pass the grade just needs to be one so if score one is false it's going to ask the next question which is score two if that is true it's going to Short Circuit from score three so score three is not going to be asked that question and you're going to pass the grade let's say score one was true was greater than 75 then it's going to Short Circuit score two and score three to giving the class grade which is pass I'm going to remind you again to be careful about the Casual use of and or or in English when determine the actual conditions that must be met when an and and or operators are combined in the same expression and operators are evaluated first meaning the and operator takes precedence in such that their Boolean values are their expressions are evaluated first now if we consider a program that determines whether a movie theater patreon can purchase a discounted ticket the Boolean expression age greater than equal to 65 and rating equal to G will be evaluated first over and above age less than equal to 12 you got to use parentheses to correct logic and force evaluations to occur in the order designed using the parenthesis kind of forces the or expression to be evaluated first it's kind of used to override the default order of operations and it's used for clarity even though they do not change the order of operations for example if you have a look at age is greater than 12 and age is less than 19 or valid ID is equal to yes which one's going to be evaluated first the parentheses I must stress the need to use parentheses when combining and and or a good example to use is the following if pet equals to dog and age is greater than 10 or age is less than five is not the same as if pet equals to dog and AG is greater than 10 or age is less than five there's the all comparison statement is in parenthesis that will be evaluated first whether that is true before it is compared to Doc mixing and and or operators makes logic quite more complicated so please try and avoid mixing an and or Decisions by using nested F statements rather so example we'll be here where we have the rating is G then if age is less than equal to 12 then output discount applies else if age is greater than 65 then IP put the discount applies and if so what we're doing is we're just just trying not to combine our and and or operators within a single comparison expression if you feel confident enough to use the or operator then you can remain using the or operator for the comparison of age is less than equal to 12 or age is greater than equal to 65 within the first decision if either one of those are true then of course you're going to up with the discount appliers if not then we're going to carry on with the rest of the program there will be no discount that concludes the section of making decisions please join me in the next videos in which we'll be discussing loops