Question: write a java function called calculate that simulates a simple calculator. given a mathematical expression stored into a string, your function should calculate a result
write a java function called calculate that simulates a simple calculator. given a mathematical expression stored into a string, your function should calculate a result and return it as a double. for example, if your function is passed the string 3.7 + 4.2 it should return the number 7.9. your calculator only needs to handle two operators + and *, and only expression containing two operands and a single operator. the three components will always be separated by a single space between each.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
