disturb 0 Newbie Poster

Please can anybody try and figure out these two questions here.

"Q1: Using the following class definitions of stack and queue classes write a templated
function reverseQueue(?), that takes a pointer to queue as a parameter and uses stack
object (or pointer to a stack object) to reverse the given queue. The function call to
reverseQueue should reverse the data of the queue passed as a parameter.

template <class T>
struct NODE {
NODE<T> *pNext;
T Data;
};

template <class T>
class stack{
private:
NODE<T> * top;
public:
stack();
~stack();
void push (T data); //pushes a new node with data type
//T in a stack
bool pop (T &data); //pops out the top most node from
//the stack
void printStack(); //prints all elements of a stack
};

template <class Type>
class queue {
private:
NODE<T> * front;
NODE<T> * tail;
public:
queue ();
~queue();
bool dequeue ( Type & data); //removes first node from
//a queue
bool enqueue (Type val); //appends a new node in a
//queue
};

Q 2: A camera retail shop requires a software to store information about cameras. The
shop has two types of cameras: digital and analog. Suppose the shop owner needs to
store information only about price, resolution and brand name. He also needs to print
the storage format of cameras. System should be able to print the storage format even
when other properties of cameras are missing or unupdated. [Hint: create a method
for format instead of property]
Storage formats cannot be generalized because digital camera stores photos in digital
chip while analog camera stores photos in photo reel. Each type of camera MUST
specify its storage format by printing storage description on screen like “storage
format for analog camera is photo reel”.
Create inheritance hierarchical structure for above scenario.
Write the class definition with implementation of all the classes you have used above.
Keep all the class members public for simplicity."