You are viewing a single comment's thread from:

RE: SEC S20W03 || Basic Programming Course: Lesson #3 Operations

in Steem SEA2 months ago (edited)

... you just needed to compare the three results at the same time.

Do you mean something like this one below where result and evaluation are grouped in to one section?

    // 3 - The Results and Evaluation; 
    Print "The value of y is: ", y;
    Print "Is " y " greater than or equal to 0? " y>=0;
    Print "The value of x is: ", x;
    Print "Is " x " greater than or equal to 0? " y>=0;
    Print "The value of z is: ", z;
    Print "Is " z " greater than or equal to 0? " y>=0;

or

// 4 – Evaluation
    Print "Is " y, x, z " greater than or equal to 0? " y>=0;


Thanks, for correction, Professor.

Sort:  

Print "Is " y, x, z " greater than or equal to 0? " y>=0 and x>=0 and z>=0;

 2 months ago 

Ah Yes! Thank you very much, Professor.

If one of them, lets say x has the value of -78, how would the program return the result? Or should I wait for the next weeks? :D

If any of the three results is false then the whole expression will be false too.

It’s like to say something like: I’m going to sing and dance in the party.

It means that you will sing and dance, both things in the party. So both expressions should be true to say that what you are saying is true

If you say: I’m going to sing or dance in the party.

This means that you could do any of the activities above, but it’s not mandatory, you could only sing but don’t dance and viceversa. So, you if you do one of the both activities then what you said is true because you said you will do one thing or the other thing, but you didn’t confirmed you will do both.

That’s the logic behind this.

If you have any other doubt then let me know!

 2 months ago 

Ah yess !!

y>=0 and x>=0 and z>=0

The AND operator.

Lesson learned: It's not just about logic but also attention to detail.
Thanks, again, Professor.

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.035
BTC 90937.36
ETH 3169.73
USDT 1.00
SBD 2.99