Question: Please help solve in C + + Only the Stack.cpp file needs to be edited. / / Main . cpp / / File: main.cpp #include

Please help solve in C++
Only the Stack.cpp file needs to be edited.
//Main.cpp
// File: main.cpp
#include "Stack.h"
#include
using namespace std;
int main(){
cout "No implementation given.";
return 0;
}// end main()
//Stack.h
// File: Stack.h
#ifndef STACK_H
#define STACK_H
/* class: Node
* The class representing a node on a singly-linked list.
*/
class Node {
public:
char data;
Node * next = nullptr;
Node(const char data) : data{data}{}
};
/* class: Stack
* The class that defines a stack. Implemented
* using a singly-linked list.
*/
class Stack {
public:
Node * head = nullptr;
char peek() const { return head->data; }
bool isEmpty() const { return head == nullptr; }
/* Methods to implement. */
void push(const char data);
char pop();
};
#endif
//Stack.cpp
// File: Stack.cpp
#include "Stack.h"
void Stack::push(const char data){
/* Type your code here. */
}
char Stack::pop(){
/* Stack must not be empty in order to pop. */
/* Type your code here. */
}
Please help solve in C + + Only the Stack.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!