Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started