Logic Gates C++ Program

Hi, I am assigned to design a C++ program that simulates a combinational logic circuit. For example, i will be prompt to select the logic gates i want (AND, NOT, NAND etc) and then i will be prompted to give the inputs and the program will execute the outputs. I have a few questions here.
1. Is it correct to declare Gate as the base class and the rest of the logic gates (AND, NOT, OR...) are the derived class?
2. What functions should i use to represent the logic gate formula? (I just need some examples)
3. How could i use polymorphism to make my program simpler?
I just started learning C++ a month ago and I have many doubts on this assignment. Really appreciate your help thanks!
Topic archived. No new replies allowed.