A
A
Andrey Ocheretyany2016-04-17 20:45:53
Java
Andrey Ocheretyany, 2016-04-17 20:45:53

How can I enter an equation using the keyboard?

There is a program that calculates the minimum of a function by enumeration. The function is defined statically in the program code. How can I make the user enter a function from the keyboard in the format, for example: x + 5? For every time I'm tired of editing the source code. So that after entering from the keyboard, this function is passed to the method and then processed.

private double function(double x){
    return x*Math.exp(x)+Math.pow(x,2);
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Gamega, 2016-04-17
@gadfi

Google about Polish notation

A
aol-nnov, 2016-04-17
@aol-nnov

Java? binshel !

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question