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

i need help with this block of code. Im having trouble figuring out if there are

ID: 3548334 • Letter: I

Question

i need help with this block of code. Im having trouble figuring out if there are any missing brackets, and if possible tell me how to make this a better looking code like reorganizing it.


if(abcd= TYP_FLOAT) {

PTreeValue result = leftval;

}

else if( abcd= TYP_INT) {

PTreeValue result = leftval;

}

if(abcd1= TYP_FLOAT) {

PTreeValue answer = rightval;

}

else if(abcd1= TYP_INT){

PTreeValue answer = rightval;

}


if((abcd&& abcd1)== TYP_FLOAT)

PTreeValue sum1 = result.getFval() + answer.getFval();

else

PTreeValue sum1 = result.getIval() + answer.getIval();

Explanation / Answer

if(abcd= TYP_FLOAT)

{

PTreeValue result = leftval;

}

else if( abcd= TYP_INT)

{

PTreeValue result = leftval;

}

if(abcd1= TYP_FLOAT)

{

PTreeValue answer = rightval;

}

else if(abcd1= TYP_INT)

{

PTreeValue answer = rightval;

}


if((abcd == TYP_FLOAT) && (abcd1== TYP_FLOAT))

PTreeValue sum1 = result.getFval() + answer.getFval();

else

PTreeValue sum1 = result.getIval() + answer.getIval();