V
V
Vasily Vasilyev2017-08-23 23:44:29
Java
Vasily Vasilyev, 2017-08-23 23:44:29

Solution calculator. How to implement?

Task: to implement a calculator with the output of a step-by-step solution of simple equations.
Input data: a string of indeterminate length. Actions: +; -; *; / ;
Output: step by step solution of the equation.
Example:
Input: 2 + 2 * 2 / 2 - 2 * 4 / 2
Output:
2 + 2 * 2 / 2 - 2 * 4 / 2 =
2 + 4 / 2 - 8 / 2 =
2 + 2 - 4 =
4 - 4 = 0
Any ideas?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Moseychuk, 2017-08-23
@Basil_Dev

Convolution optimization. The list of intermediate steps is the solution.
https://ru.wikipedia.org/wiki/%D0%A1%D0%B2%D1%91%D...

A
anwender95, 2017-08-24
@anwender95


My shit code in c++ that implements step-by-step solution of equations (taking into account operator precedence) and supports variables and constants. Slightly unfinished, but there is a command line interpreter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question