Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I keep getting an error. I was wondering what i was doing wrong. Create your cod

ID: 3889459 • Letter: I

Question

I keep getting an error. I was wondering what i was doing wrong.

Create your code in p1abc123.c (replace abc123 with your abc123 ID). It must not contain the code from the driver!! Based on what the driver calls, you need to create (at least) this function: int convertToPostfix(char *pszInfix, Out out) It returns 0 if it converted successfully. Otherwise, it returns a value which indicates an error in the infix expression (e.g., missing left paren, missing right paren). It populates the out array using the addPostfixOut function (provided in the driver). For modularity, you will need to divide convertToPostfix into multiple functions. • To compile the driver, your code, and create an executable, use the make utility

This should be the output

int actualConversion(Element element, PostfixOut postfixout, Stack stack){

switch(element.iCategory)
{
case CAT_OPERAND:
addOut(out,element);
break;

case CAT_OPERATOR:
while (isEmpty(stack) == FALSE && element.iPrecedence < topElement(stack).iPrecedence) //Continuous loop until stack is empty
{

addOut(out,pop(stack));
}

push(stack,element);
break;

case CAT_LPAREN:
push(stack,element);
break;
case CAT_RPAREN;
while(isEmpty(stack) == False && topElement(stack).iCategory != CAT_LPAREN)
{
addOut(out,pop(stack));
}

if(isEmpty(stack) == TRUE) //For when we didn't fine a '('
{
freeStack(stack);
return WARN_MISSING_LPAREN;
}
pop(stack);
break;
}
return 0;
}

int remainingStack(Stack stack, PutfixOut putfixout)
{
while(isEmpty(stack) == FALSE)
{
if(topElement(stack).iCategory == CAT_LPAREN) //for when an unmaatched '(' is found
{
freeStack(stack);
return WARN_MISSING_RPAREN;
}
addOut(out,pop(stack));
}
return 0;
}

convertToPostFix(char * pszInfix,PostfixOut postfixOut)
{
Stack stack = newStack();
Token szToken;

while((pszInfix = getToken(pszInfix, szToken, MAX_TOKEN + 1))! = 0)
{
Element element;
strcpy(element.szToken,szToken);
categorize(& element); //initialize the Elements variable values based on the token string entered
}

int i;

i = actualConversion(element, out, stack);
if (i< >0) return i;
i = remainingStack(stack, out);
if(i < >0) return i;

freeStack(stack);
return 0;
}

Explanation / Answer

< > is not recognised

NOT EQUAL TO is !=

So you need to write
if (i != 0) return i;

After doing this let me know if there is any more errors