I am trying to do a program which does simple maths by scanning
using provided three items (two number and an operator) then let the program
do the calculatin and printout the result.
The way i have attempted it so far (below is the code) the value of the operator is also being included in the result.
Anyhelp to help me look at what i should do will be appreciated.
package jaavv;
import java.util.*;
public class Linie {
public static void main(String[] args){
String ti,ch,gi;
System.out.println("Please type your question here!");
Scanner adder = new Scanner(System.in);
ti = adder.next();
ch = adder.next();
gi = adder.next();
double newTi = Double.parseDouble(ti);
char newCh = ch.charAt(0);
double newGi = Double.parseDouble(gi);
System.out.println (newTi + newCh + newGi);
}
}