I am working on a C++ program using stacks. The program is to check and see if an experssion entered by the user is well-formed or not. There are 3 different settings, 1. Basic brackets () 2. Stanard brackets (){}[] and 3. User-defind brackets. I have Three files main.cpp, stackLS.cpp, stackLS.h. It's a simple program that should only tell the user if the expression they entered is well-formed or not. Nothing more. I am having some issues though. I will past the codes below:
#pragma once
#ifndef _STACKLS_
#define _STACKLS_
#include <iostream>
usingnamespace std;
typedefchar elemType; // flexible data type
class StackLS
{
private:
// inner class node
class Node
{
public:
elemType data; // data portion
Node *next; // link to the seccessor
}; // end Node
// data members
Node *topItem; // pointer to the top element of this stack
// utilities
public:
// constructors
StackLS(void); // default constructor
StackLS(const StackLS& aStack); // copy constructor
// observers
bool isEmpty(void) const;
// returns true if this stack is empty
// false otherwise
bool isFull(void) const;
// returns true if this stack is full
// false otherwise
elemType top(void) const;
// precondition: this stack is not empty
// returns top element in this stack
// transformers
void push(const elemType& item);
// precondition: this stack is not full
// adds item to this stack
void pop(void);
// removes top element from this stack if exist
// remains empty otherwise
void makeEmpty(void);
// makes this stack empty
// destructor
~StackLS(void);
}; // end StackLS
#endif
If someone could please help me get it started, I would appreciate it. I have some started in the main.cpp but I know that it is not right. I'm stuck on what to do. Thanks again. If you need more information, let me know what information and I will add it to here. Thanks