Question: Input Your program will take three lines of input: A string representing the logic gate being tested A string representing the first gate input A
Input
Your program will take three lines of input:
A string representing the logic gate being tested
A string representing the first gate input
A string representing the second gate input
Output
Your program should only print one line of output in all cases. For the first time this
week, we will ask you to validate that the user input is correct within your own program.
Check for an invalid gate input first. If the logic gate input is not a valid gate type
a member of AND, OR NAND, NOR, XOR or XNOR then your program must output: "OUTPUT
Invalid Gate
After confirming the gate is correct, check if either of the following two inputs is not a
or Check the first input first and the second input second. If one of the inputs is invalid,
your program must output: "OUTPUT Invalid Input
If all inputs are valid, the program should then output the correct boolean value for the
given gate type and inputs. Eg OUTPUT True
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
