Question: Create methods that work like an AND - gate and a NOR - gate There are multiple ways to check a relationship between two values.

Create methods that work like an AND-gate and a NOR-gate
There are multiple ways to check a relationship between two values. In this question, we will input combinations of zeros (0) and ones (1).
Please create the following two static methods: andGate() & norGate()
They should perform the functions of their respective gates and print true for 1 and false for 0 in the console.
An AND-gate returns 1(true) only if both inputs are equal to 1, and 0(false) otherwise.
A NOR-gate returns 1(true) only if both inputs are equal to 0, and 0(false) otherwise.
In this application we will represent our true input as 1 and false input as 0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!