Making Decision
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Understanding OR Logic

+18
kylenicole
Alliah Faith
Asdfghjkl
jaketadios04
Emie Ligutan
rapzie badoodles
Ferre
iramae
ilovebts
Myra Monique Acuna
airojames
Pox
Lawrence
althea faye
Sean Monacillo
Luwiezz
justjoking10
rheigne
22 posters
Go down
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Understanding OR Logic

Wed Jul 25, 2018 9:05 am
Using the OR Operator
If you need to take action when either one or the other of two conditions is met, you can use two separate, nested selection structures, as in the previous examples. However, most programming languages allow you to make two or more decisions in a single comparison by using a conditional OR operator (or simply the OR operator).

When you use the logical OR operator, only one of the listed conditions must be met for the resulting action to take place. Quick reference 2-1 contains the truth table for the OR operator. As you can see in the table, the entire expression x OR y is false only when x and y each are false individually.

Understanding OR Logic Screen11
Quick reference 2-1 OR Logic Truth Table


For example, suppose the cell phone company has established a new fee schedule as follows: The basic monthly service bill is $30. An additional $20 is billed to customers who make more than 100 calls or send more than 200 text messages.



If the programming language you use supports the OR operator, you still must realize that the comparison you place first is the expression that will be evaluated first, and cases that pass the test of the first comparison will not proceed to the second comparison. As with the AND operator, this feature is called short-circuiting. The computer can ask only one question at a time; even when you write code as shown at the top of Figure 2-1, the computer will execute the logic shown at the bottom.

[/color]
Understanding OR Logic Or11
Figure 2-1 Using an OR operator and the logic behind it


Logic Example


Understanding OR Logic Slidin10
Figure 2-2 An automatic Glass Door

Let's say people GOING IN is x(considered 1 when a man is sensed and 0 if none), those who are GOING OUT is y(considered 1 when a man is sensed and 0 if none), and the movement of the door is the result(considered 1 when it opens and 0 if not).

With that, I have made this truth table.

Understanding OR Logic Orttt12

Did you UNDERSTAND OR LOGIC?
If yes, would you please give different example/application of it?
        else comment down below your reactions/questions.
avatar
rheigne
Posts : 1
Join date : 2018-08-01

Understanding OR Logic Empty ?

Wed Aug 01, 2018 6:18 pm
The topic is very well explained but sir, naguguluhan lang ako, anong pinagkaiba niya sa While Statement? Yun po kasi ang hindi ko mapagtanto Suspect Suspect
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 01, 2018 6:28 pm
rheigne wrote:The topic is very well explained but sir, naguguluhan lang ako, anong pinagkaiba niya sa While Statement? Yun po kasi ang hindi ko mapagtanto Suspect Suspect

yung while eh ginagamit sa looping, hindi pa naman tayo nagloloop dito ✌️
avatar
justjoking10
Guru
Posts : 19
Join date : 2018-08-01

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 01, 2018 6:36 pm
rheigne wrote:The topic is very well explained but sir, naguguluhan lang ako, anong pinagkaiba niya sa While Statement? Yun po kasi ang hindi ko mapagtanto Suspect Suspect

Ang topic ni sir dito ay about selection. S looping p ung while statement.
avatar
jander
Guest

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 01, 2018 6:52 pm
This topic is very nice, sir you're a great teacher,but I do not understand much, I'm a little confused, but I try my best to understand.
avatar
justjoking10
Guru
Posts : 19
Join date : 2018-08-01

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 01, 2018 6:58 pm
The topic is very well explained sir.
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 01, 2018 7:07 pm
justjoking10 wrote:The topic is very well explained sir.
That's good to know from you. Are you sure you understand? Can you give another example?
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 7:42 am
jander wrote:This topic is very nice, sir you're a great teacher,but I do not understand much, I'm a little confused, but I try my best to understand.
I will also give my best for you to understand. What part are you confused?
avatar
Luwiezz
Newbie
Posts : 3
Join date : 2018-08-02

Understanding OR Logic Empty I LOVE IT

Thu Aug 02, 2018 6:48 pm
Thank you for posting this, a big help for me understanding OR logic. I will assure you that I will perform well the next time
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 7:37 pm
Luwiezz wrote:Thank you for posting this, a big help for me understanding OR logic. I will assure you that I will perform well the next time
Good to know that this forum helps you. You can share this to your friends to let them know and understand OR Logic too.
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:18 pm
Regarding sa tanong ni rheign 😊 . Yung WHILE STATEMENT sa loop yun rheign tapos kapag OR LOGIC ang gamit mo lang jan is yung IF STATEMENT . pero pwede ka din naman ata mag OR LOGIC SA WHILE LOOP I guess. di lang ako sure sana masagot ni sir if pwede . hehehe 😂 .

Sent from Topic'it App
avatar
justjoking10
Guru
Posts : 19
Join date : 2018-08-01

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:45 pm
Admin wrote:
justjoking10 wrote:The topic is very well explained sir.
That's good to know from you. Are you sure you understand? Can you give another example?

Pamasahe po s jeep.

if customer is Senior OR Student then
WITH DISCOUNT
else
NO DISCOUNT
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:53 pm
Sean Monacillo wrote:Regarding sa tanong ni rheign 😊 . Yung WHILE STATEMENT sa loop yun rheign tapos kapag OR LOGIC ang gamit mo lang jan is yung IF STATEMENT . pero pwede ka din naman ata mag OR LOGIC SA WHILE LOOP I guess. di lang ako sure sana masagot ni sir if pwede .  hehehe 😂 .

Sent from Topic'it App
Yes you can incorporate OR in a Loop.
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:54 pm
justjoking10 wrote:
Admin wrote:
justjoking10 wrote:The topic is very well explained sir.
That's good to know from you. Are you sure you understand? Can you give another example?

Pamasahe po s jeep.

if customer is Senior OR Student then
WITH DISCOUNT
else
NO DISCOUNT
Very Good. Ang nagkakagulo ngayon dyan eh yung process after that, diba 20% ang discount so magkano dapat ang binabayad ng STUDENT or SENIOR?
avatar
justjoking10
Guru
Posts : 19
Join date : 2018-08-01

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:57 pm
Admin wrote:
justjoking10 wrote:
Admin wrote:
justjoking10 wrote:The topic is very well explained sir.
That's good to know from you. Are you sure you understand? Can you give another example?

Pamasahe po s jeep.

if customer is Senior OR Student then
WITH DISCOUNT
else
NO DISCOUNT
Very Good. Ang nagkakagulo ngayon dyan eh yung process after that, diba 20% ang discount so magkano dapat ang binabayad ng STUDENT or SENIO??

9 pesos is the minimum fare.
9 * 0.20 = 1.80.
9 - 1.80 = 7.20
Round to 7
Pero sir mas maikli po sya pag ganto.
9 * 0.80 = 7.20
Round to 7
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:58 pm
Admin wrote:
Sean Monacillo wrote:Regarding sa tanong ni rheign 😊 . Yung WHILE STATEMENT sa loop yun rheign tapos kapag OR LOGIC ang gamit mo lang jan is yung IF STATEMENT . pero pwede ka din naman ata mag OR LOGIC SA WHILE LOOP I guess. di lang ako sure sana masagot ni sir if pwede .  hehehe 😂 .

Yes you can incorporate OR in a Loop.
Thank you sir 😊 tama na yung nasa isip ko hehehe

Sent from Topic'it App
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Thu Aug 02, 2018 8:58 pm
justjoking10 wrote:
Admin wrote:
justjoking10 wrote:
Admin wrote:
justjoking10 wrote:The topic is very well explained sir.
That's good to know from you. Are you sure you understand? Can you give another example?

Pamasahe po s jeep.

if customer is Senior OR Student then
WITH DISCOUNT
else
NO DISCOUNT
Very Good. Ang nagkakagulo ngayon dyan eh yung process after that, diba 20% ang discount so magkano dapat ang binabayad ng STUDENT or SENIO??

9 pesos is the minimum fare.
9 * 0.20 = 1.80.
9 - 1.80 = 7.20
Round to 7
Pero sir mas maikli po sya pag ganto.
9 * 0.80  = 7.20
Round to 7
Yun nga ehh kaso "may mga ilan", na driver na 8 ang singil.
avatar
althea faye
Guru
Posts : 10
Join date : 2018-08-07

Understanding OR Logic Empty Re: Understanding OR Logic

Tue Aug 07, 2018 8:45 am
What is the purpose of logic gates?
avatar
althea faye
Guru
Posts : 10
Join date : 2018-08-07

Understanding OR Logic Empty Re: Understanding OR Logic

Tue Aug 07, 2018 8:46 am
What is the purpose of logic gates?
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Tue Aug 07, 2018 9:05 am
althea faye wrote:What is the purpose of logic gates?
It used to create a wider and specific logic. Logic gates can be found in an IC, and a group of IC is a huge contribution to build a computer.
avatar
althea faye
Guru
Posts : 10
Join date : 2018-08-07

Understanding OR Logic Empty Re: Understanding OR Logic

Tue Aug 07, 2018 9:39 am
Luwiezz wrote:Thank you for posting this, a big help for me understanding OR logic. I will assure you that I will perform well the next time
it can help a lot for us inspiring programmers . Very Happy Very Happy Very Happy
avatar
iramae
Guru
Posts : 10
Join date : 2018-08-08

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 08, 2018 7:59 am
Ang Boolean expressions ang hindi talaga nawawala pagdating sa programming. Parang yun na din kase yung basis kung pano tatakbo yung program.
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding OR Logic Empty Re: Understanding OR Logic

Wed Aug 08, 2018 8:27 am
iramae wrote:Ang Boolean expressions ang hindi talaga nawawala pagdating sa programming. Parang yun na din kase yung basis kung pano tatakbo yung program.
Yes, in computing its a matter of True or False, On or Off, 1 or 0. Very Happy
Lawrence
Lawrence
Guru
Posts : 10
Join date : 2018-08-11

Understanding OR Logic Empty Re: Understanding OR Logic

Sat Aug 11, 2018 6:29 pm
rheigne wrote:The topic is very well explained but sir, naguguluhan lang ako, anong pinagkaiba niya sa While Statement? Yun po kasi ang hindi ko mapagtanto Suspect Suspect
i think yung while is for looping lang siya Smile
Lawrence
Lawrence
Guru
Posts : 10
Join date : 2018-08-11

Understanding OR Logic Empty Re: Understanding OR Logic

Sat Aug 11, 2018 6:34 pm
Admin wrote:
justjoking10 wrote:The topic is very well explained sir.
That's good to know from you. Are you sure you understand? Can you give another example?
sir pwede po siguro example po yung sa pag gigitara sir. if gusto po natin matuto mag gitara. dalawang choices po bale its either na hihiram tayo ng gitara OR bibili po ng gitara. it means po kahit san po sa dalawa, matuto ka padin po mga gitara Smile
Sponsored content

Understanding OR Logic Empty Re: Understanding OR Logic

Back to top
Permissions in this forum:
You cannot reply to topics in this forum