In relatively new to java though i have been programming for sometime now. i figure doing a fun math project for my daughter to help her learn math would be an easy way to test what java is capable of. So in effort to try and learn efficient ways of doing programming, Is there a way to convert a string or character value from (/,,-,+) to an operator /-+?
example:
string/char textin = ""
text = JOptionPane "input box" ("*")
int results = 0
int num1 = 9
int num2 = 5
public static void calc(int num1,int num2, string/char textin)
{
results = num1 "some method"(textin) num2 // convert "*" to *
}
The purpose of this question is to reduce the amount of calculations needed to due all four operators. To use one generic method to do all four operators. Is this possible?