Question: 1.Object Oriented Programming c++ The following question investigates the Item class, which contains two member variables: string name and int price. We consider two Items
1.Object Oriented Programming c++
The following question investigates the Item class, which contains two member variables: string name and int price. We consider two Items to be equal if they have the same name and price.
Consider a function bool equal (Item& i1, Item& i2) that returns true if the two Items are equal. Explain how to give the equal function access to the private variables without using public functions, and declare the function.
2. Abstract Data Types c++
ii. Define a class called ListStack which inherits from StackInterface. ListStack uses a linked-list of Nodes for its stack. struct Node{
Node* next;
int value; }
iii. Implement the function of ListStack that pushes new items onto the stack.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
