Hi everyone, I'm quite new to programming and have come across an error in my program that is throwing me for a loop. I've tested the code on a friend's computer and it worked but when I copy and pasted it onto my laptop suddenly my switch line is giving me an error code that says " Cannot switch on a value of type String for source level below 1.7" I went online and downloaded a 64bit 1.7 library and when I switched the library over suddenly error codes were appearing everywhere. Here is my code and any help would be greatly appreciated! Thanks in advance everyone and please don't be too harsh if I ask seemingly stupid questions. I've only been at programming for a couple weeks.
import java.io.BufferedReader;
import java.io.FileReader;
public class calculator {
static int a = 0;
static int b; //this is the first term
static int c; //this is the second term
static int d; //this is my final answers
public static void main(String args[]) throws Exception{
FileReader cats = new FileReader("File's Address");
BufferedReader dogs = new BufferedReader(cats);
String fish;
while((fish = dogs.readLine()) != null){
String[] variabizzles = fish.split(" ");
a++;
b = Integer.parseInt(variabizzles[0]);
String operator = variabizzles[1];
c = Integer.parseInt(variabizzles[2]);
switch(variabizzles[1]){
case "+": d = b + c;
break;
case "-": d = b - c; //This was a much better plan than the fail IF/ELSE statements.
break;
case "/": d = b / c;
break;
case "*": d = b * c;
}
System.out.println("Problem " + a + ": " + b + operator + c + "=" + d);
}
}
}