So I have this project to do, that I need to read a text file named Input, and I'm doing it like this:
public static void textParser() {
File inputFile = new File("Input.txt");
try {
BufferedReader br = new BufferedReader(new FileReader(inputFile));
String inputsText;
while ((inputsText = br.readLine()) != null) {
System.out.println(inputsText);
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
}
and it works. Inside of Input.txt, it shows:
6
10 + 4
12 - 3
1000 / 50
9 * 64
2^5
90 % 8
1 + 1
6 * 4
The first line (6) will always be the amount of equations to-do, can be different than 6. Then I have to do how many equations the first line says to, how would I go on doing that? Thanks!