Java + OOP + Logic Gates = HELP!
If you were asked to write a program that would be able to draw a network of gates on the screen and determine the output of that network, you should design several classes. Design these classes. Draw a diagram to show how the classes are related. Include a detailed description of ALL encapsulated data and ALL methods you would need. (No actual steps are required for your methods)
okay so at first this task seemed easy... I decided that there should be an abstract Gate class, that has 2 instance variables (int input1,int input2) and the method would be calcOutput which determines an output based on the inputs. Then AND, OR, NOT, NAND, etc would all be subclasses of this class inheriting these variables and the method, but it seems a far too simple solution and i must be overlooking some cases..:confused: