Question: Your task is to read a file containing arithmetic instructions such as 3 + 4 4 - 10 7 * 11 Each instruction contains an
Your task is to read a file containing arithmetic instructions such as
3 + 4 4 - 10 7 * 11
Each instruction contains an integer, an operator (+, -, or *), and another integer.
Return an array list of the results. If there is any error, throw an IOException.
Complete the following file:
Arithmetic.java
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Scanner;
public class Arithmetic { /** This class reads a file containing arithmetic expressions and returns an array list of the results. @param filename the file name @return a list of results */ public static ArrayList
(P.S. where the "..." is where I have to add new code can't change anything else"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
