Problem 42296. String math
You will be given a string that describes a simple math equation. Your job is to determine if the value of the equation is equal to the number of letters in the string, not including spaces. Multiplication and division come before addition and subtraction when calculating the equation, just like in real life. For example:
'four plus eight' has thirteen non-space characters, but 4+8=12, so this would return false.
'eight plus six times two' has twenty non-space characters. 8+6*2=20, so this would return a true.
Only the numbers 0-9 will be included in this exercise. Operational terms are
- plus
- minus
- times
- multiplied by
- divided by
Good luck!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers25
Suggested Problems
-
Back to basics 25 - Valid variable names
322 Solvers
-
Make a random, non-repeating vector.
8750 Solvers
-
Return the first and last characters of a character array
9412 Solvers
-
Given a window, how many subsets of a vector sum positive
850 Solvers
-
Make a vector of prime numbers
633 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!