### very hard question using stacks!!

hey everyone!! im facing a really hard question in my data structure course.
here is the question:

Given a number of digits your program is required to print the addition result of these numbers.
Write a C++ program that simply add numbers (using stacks), the program reads in floating point numbers, push them onto a stack, add them together whenever a plus sign, "+", is entered, and print the result. In addition, the adding machine will recognize the following instructions:
 A comma "," means a "cancel the last entry".
 A period "." means "cancel all entries", that is clear the stack.
 Making sure that the input is either a floating number or “+” or “,” or “.” characters.

I need someone to help me with this please :/
Here is the code I wrote but it doesn't seem to be right

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697`` ``````#include using namespace std; class CustomStack { private: float* myStack; int size; int top; public: CustomStack(int sizeValue) { size = sizeValue; top = -1; myStack = new float[size]; } float isEmpty() { if(top == -1) { return true; } return false; } bool isFull() { if(top == size-1) { return true; } return false; } void push(float element) { if(!isFull()) { myStack[++top] = element; } } float pop() { return myStack[top--]; } float peek() { return myStack[top]; } }; void main () { float x; float sum=0.0; CustomStack stack (5); cout<<"please enter a group of numbers"<>x; stack.push(x); sum=sum+x; } cout<<"please enter + , or ."<>sign; if (sign=='+') { cout<

I have 2 problems
first: I want the program to continue working even if the user inserted ',' or '.'
second: when the user inserts ',' it deletes the first input while I want it to delete the last input

I wish someone can help me with that