So my post got closed because it said it's an assignment but i thought we are allowed to get HELP just not answers and if we are making an effort????
This is my code from the previous question:
public class Question2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
int num1 = in.nextInt();
String character = in.next();
int num2 = in.nextInt();
int sum = 0;
switch (character) {
case "+":
sum = num1 + num2;
System.out.println(sum);
break;
case "-":
sum = num1 - num2;
System.out.println(sum);
break;
case "x":
sum = num1 * num2;
System.out.println(sum);
break;
case "/":
double sumD = (double)num1 / (double) num2;
System.out.println(sumD);
break;
default:
System.out.println("unknown operator");
break;
}
}
}
}```
I just want help with being pointed in the right direction. I did the previous question and just need to figure out how to extend it.
Thank you.