Question: Operators & Binary Arrays Designed to test skills: operators (logical, relational, arithmetic, etc.), operands (binary, numeric, scalars and/or arrays), binary arrays with functions (e.g., mean,


Operators & Binary Arrays Designed to test skills: operators (logical, relational, arithmetic, etc.), operands (binary, numeric, scalars and/or arrays), binary arrays with functions (e.g., mean, sum, find), and binary arrays with other arrays (extraction, multiplication, etc.) ENGR 1221 Ask the user for the state of each switch. Then tell the user corresponding state of the light bulb Create an anonymous function (accepting 3 inputs) where you use logical operators to determine and return the state of the light bulb. Note: DO NOT over complicate this task. N"if" statements are allowed-just use binary inputs and a binary output. Show results for the following test cases: b. SW1-1 SW2 1 SW3-0 c. SW1-0 SW2-1 SW3-1 d. SW1-1 SW2 0 SW3-0 For matrices A and B, if the values of the individual cells match, place that value into a new matrix C, otherwise the value should be 0. You can use 1 arithmetic operator and 1 logical relational operator to calculate C. Reminder: loops are not allowed on this assignment. 4. A-9.00 4.00 2.00 B= 5.00 4.00 3.00 7.00 5.00 3.00 7.00 6.00 8.00 6.00 8.00 9.00 9.00 2.00 9.00 4.00 0 7.00 0 0 0 0 9.00 Operators & Binary Arrays Designed to test skills: operators (logical, relational, arithmetic, etc.), operands (binary, numeric, scalars and/or arrays), binary arrays with functions (e.g., mean, sum, find), and binary arrays with other arrays (extraction, multiplication, etc.) ENGR 1221 Ask the user for the state of each switch. Then tell the user corresponding state of the light bulb Create an anonymous function (accepting 3 inputs) where you use logical operators to determine and return the state of the light bulb. Note: DO NOT over complicate this task. N"if" statements are allowed-just use binary inputs and a binary output. Show results for the following test cases: b. SW1-1 SW2 1 SW3-0 c. SW1-0 SW2-1 SW3-1 d. SW1-1 SW2 0 SW3-0 For matrices A and B, if the values of the individual cells match, place that value into a new matrix C, otherwise the value should be 0. You can use 1 arithmetic operator and 1 logical relational operator to calculate C. Reminder: loops are not allowed on this assignment. 4. A-9.00 4.00 2.00 B= 5.00 4.00 3.00 7.00 5.00 3.00 7.00 6.00 8.00 6.00 8.00 9.00 9.00 2.00 9.00 4.00 0 7.00 0 0 0 0 9.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
