Define the recursive function numexprs that returns the number of part expressions when given an arithmetic expression. Note that even bool is a part expression.(Individual parentheses are not counted as part expressions.) Evaluate your function on the expression below, and verify that it returns the expected value of 8.
I don't understand how I should define the recursive function. The question states that I should count the number of part expression in a given arithmetic expression, but the example I'm supposed to verify isn't even an arithmetic expression? I feel very confused.
I was thinking of using something similar to this when defining the function: