Re: Inheritance program help
Ok
Quote:
1)Write a Java program to simulate the operation of:
A)AND: a && b
B)OR: a || b
C)NAND: !( a && b)
D)NOR: !(a || b )
2)Using:
A)the principles of INHERITANCE
B)The Gates SuperClass has 2-Inputs and 1-Output.
C)The three individual SubClasses inherit the number of Inputs [a, b] and Output [c] from the SuperClass (Gates).
D)The four SubClass gates have their own specific and independent functions:
Before you begin
Define INHERITANCE in Java.
Turn the instructions into pseudo-code
Re: Inheritance program help
my main confusion with the assignment is what the purpose of this is and what the outcome should look like. From what I understand I'm creating a Superclass called Gates and AND OR NAND NOR will all be subclasses and that I should extend them using keyword.
Re: Inheritance program help
Quote:
my main confusion with the assignment is what the purpose of this is
Instructors get a pay-raise every time someone asks that question on a forum. It is like a bonus.
Quote:
what the outcome should look like
What did the instructions say the output should look like? ... Exactly like that.
Quote:
From what I understand I'm creating a Superclass called Gates and AND OR NAND NOR will all be subclasses and that I should extend them using keyword.
Sounds like a plan. Does this plan solve the problem while following all of the rules?