Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ question You are NOT allowed to use any kind of loops in any part of your submitted code. You are NOT allowed to use

C++ question

image text in transcribedimage text in transcribed
You are NOT allowed to use any kind of loops in any part of your submitted code. You are NOT allowed to use goto. You are NOT allowed to use any global variable, or static variable like static int x. You are NOT allowed to include any additional libraries (e.g. cstring library or cmath library) yourself. Everything you need is already included. However, feel free to implement any functions you need yourself with recursion. You are NOT allowed to modify any of the given function prototypes including the return types, function names, and parameter lists. (but you can overload them if you want we will explain why you might want to do that later) int evaluate(const char str) This function returns the integer result of a given formula stored in the non-empty C-string str. You can assume the given string always represents a valid formula which is defined as a formula that can be printed by the given printArray function. Examples: . If str is "1+1", the function should return 2. . If str is "-2", the function should return -2. . If str is "123-456", the function should return -333. . If str is "123-456+8-9+2", the function should return -332. Hint: While you cannot use any function from the cstring library or any other libraries, you can implement the "strlen" function with recursion yourself for this task if needed

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

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions

Question

The location of the neuro centre activity of the heart is.......?

Answered: 1 week ago