Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7.10 Expression Evaluation In the 9th lecture of EECS2031-M, you have seen an example by which an expression that contains '+' was evaluated. In this

image text in transcribed

7.10 Expression Evaluation In the 9th lecture of EECS2031-M, you have seen an example by which an expression that contains '+' was evaluated. In this lab, you are to complete that example and write a recursion that evaluates an expression that contains both plus and minus sign. The function that you write is called total and gets three parameters including a string (an array of character) and two integers. At first call, the first integer has the value of O and the second integer points to the last element of the array. We know that the input string contains only one digit numbers, '+' and '-' with no white spaces. Sample input to total: ("6+1-2+3-7-2-3+5", 0, 14) corresponding output: 1 299436.1775812 LAB ACTIVITY 7.10.1: Expression Evaluation 0/5 main.c Load default template... 1 # include 2 # include 3 4 // insert your code here 5 int maino { char exp[1024] = "6+1-2+3-7-2-3+5"; 7 printf("%d ", total (exp. 0, strlen(exp) - 1)); 8 return 0; 9}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions