Question: From our expert: The stack defined has int* data whereas we need an operator stack(stack to store characters like + - * / %). I'm

From our expert: The stack defined has int* data whereas we need an operator stack(stack to store characters like + - * / %).

I'm not sure how to do that..could you please show me what I need to add to my code and where to add it? I would really appreciate it.

From our expert: The stack defined has int* data whereas we need

an operator stack(stack to store characters like + - * / %).

I'm not sure how to do that..could you please show me what

I need to add to my code and where to add it?

In C++, using my program stack.h and stack.cpp (shown below the instructions), Create the postfix.cpp file the converts an infix expression into a postfix expression. You must us the stack.h and stack.cpp implemented in Part 1. The program must allow the user inputs, and th inputs should not include any alphabets. You need to handle '(', ')', '+', '-', '/,,'*, and '\% operators. ' ' will not be considered in this program. Also, please consider only one digit numbers. The expected output is also shown below. \#pragma once \#ifndef STACK_H \#define STACK_H class Stack \{ private: int* data; //array to store elements of the stack int capacity; //maximum number of elements that can be stored in the stack int topIndex; //index of the top element in the stack public: Stack(int capacity); //constructor Stack()i// destructor void push(int element); //pushes an element onto the stack int pop(); //removes and returns the top element from the stack int top(); //returns the top element from the stack without removing it bool iskmpty(); //checks if stack is empty-returns true if stack is empty and //false otherwise bool isfullo ; //checks if stack is full-returns true if stack is full and false //otherwise int size(); //gets the number of elements in the stack void print(); //prints the elements in the stack 3i Test your program carefully. Here are some data tests for your program and output expected. Output Enter an infix expression: 2+34 The postfix form is 234+ Enter an infix expression: (1+2)7 The postfix form is 12+7 Enter an infix expression: ab+c I cannot create a postfix form - Error Enter an infix expression: (7+87 I cannot create a postfix form - Error Enter an infix expression: (9+7)4 I cannot create a postfix form - Error Enter an infix expression: 248/ I cannot create a postfix form - Error

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 Databases Questions!