09. Conditional Statements πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ—οΈ Create an Algorithm Using Conditional Statements

  • As a developer, I want to write an algorithm that will take in two expressions and evaluate whether both expressions evaluate to true, only one expression evaluates to true, or both expressions evaluate to false.

Acceptance Criteria

  • It’s done when the message “True βœ… True βœ…” is logged when both expression1 and expression2 are true.

  • It’s done when the message “True βœ… False ❌” is logged when expression1 is true.

  • It’s done when the message “False ❌ True βœ…” is logged when expression2 is true.

  • It’s done when the message “False ❌ False ❌” is logged when both expression1 and expression2 are false.

πŸ’‘ Hints

Before you start writing your algorithm, do you have a plan documented in plain language that describes how you will use JavaScript to get it done?

πŸ† Bonus

If you have completed this activity, further your knowledge by answering this question:

  • What is a switch case?

Use Google or another search engine to research this.


starter code

// Change the values and operators below to test your algorithm meets all conditions
var x = 50;
var expression1 = (x < 25);
var expression2 = (x > 50);

// Write Your JavaScript Code Here
//...

βœ… Solutions

Solutions Click Here