Question: import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions. * ; ^ import org.junit.jupiter.api.BeforeEach; ^ public class ExpressionTreeTest { import org.junit.jupiter.api.Test; ^ / / You can initialize your ExpressionTree

import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; ^ import org.junit.jupiter.api.BeforeEach; ^ public class ExpressionTreeTest { import org.junit.jupiter.api.Test; ^// You can initialize your ExpressionTree objects here before each test @BeforeEach ^ symbol: class BeforeEach location: class ExpressionTreeTest tree = new ExpressionTree("34+"); @Test ^ symbol: class Test location: class ExpressionTreeTest tree = new ExpressionTree("345*+"); @Test ^ symbol: class Test location: class ExpressionTreeTest tree = new ExpressionTree("50/"); @Test ^ symbol: class Test location: class ExpressionTreeTest tree = new ExpressionTree("34++"); @Test ^ symbol: class Test location: class ExpressionTreeTest tree = new ExpressionTree(""); @Test ^ symbol: class Test location: class ExpressionTreeTest tree = new ExpressionTree("34+5*"); @Test ^ symbol: class Test location: class ExpressionTreeTest tree = new ExpressionTree("102/3+4*"); @Test ^ symbol: class Test location: class ExpressionTreeTest assertEquals(7, tree.evaluate()); assertTrue(tree.parse()); ^ symbol: method assertTrue(boolean) location: class ExpressionTreeTest assertEquals("(3+4)", tree.infixNotation()); assertNotNull(tree.getRoot()); ^ symbol: method assertNotNull(BinaryNode) location: class ExpressionTreeTest } assertEquals(7, tree.evaluate()); ^ symbol: method assertEquals(int,int) location: class ExpressionTreeTest assertEquals("(3+4)", tree.infixNotation()); ^ symbol: method assertEquals(String,String) location: class ExpressionTreeTest assertEquals("(3+(4*5))", tree.infixNotation()); assertTrue(tree.parse()); ^ symbol: method assertTrue(boolean) location: class ExpressionTreeTest } assertEquals(23, tree.evaluate()); //(3+(4*5))=23^ symbol: method assertEquals(int,int) location: class ExpressionTreeTest assertEquals("(3+(4*5))", tree.infixNotation()); ^ symbol: method assertEquals(String,String) location: class ExpressionTreeTest assertThrows(ArithmeticException.class, ()-> tree.evaluate()); ^ symbol: method assertThrows(Class,()->tree.evaluate()) location: class ExpressionTreeTest } assertFalse(tree.parse()); ^ symbol: method assertFalse(boolean) location: class ExpressionTreeTest assertNull(tree.getRoot()); ^ symbol: method assertNull(BinaryNode) location: class ExpressionTreeTest } assertFalse(tree.parse()); ^ symbol: method assertFalse(boolean) location: class ExpressionTreeTest assertNull(tree.getRoot()); ^ symbol: method assertNull(BinaryNode) location: class ExpressionTreeTest assertEquals("((3+4)*5)", tree.infixNotation()); assertTrue(tree.parse()); ^ symbol: method assertTrue(boolean) location: class ExpressionTreeTest } assertEquals(35, tree.evaluate()); //(3+4)*5=35^ symbol: method assertEquals(int,int) location: class ExpressionTreeTest assertEquals("((3+4)*5)", tree.infixNotation()); ^ symbol: method assertEquals(String,String) location: class ExpressionTreeTest assertEquals("(((10/2)+3)*4)", tree.infixNotation()); assertTrue(tree.parse()); ^ symbol: method assertTrue(boolean) location: class ExpressionTreeTest } assertEquals(16, tree.evaluate()); //((10/2)+3)*4=16^ symbol: method assertEquals(int,int) location: class ExpressionTreeTest } assertEquals("(((10/2)+3)*4)", tree.infixNotation()); ^ symbol: method assertEquals(String,String) location: class ExpressionTreeTest 29 errors
this is what I got, I cant add any other classes or xml files so i have to make sure everything is covered in those two classes

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!