--read mathematical equation from user input

--parse input when user hits enter (newline)

--if user types quit it ends the program

--will need to be able to handle parenthesis

--must follow order of operations

--should handle addition, subtraction, multiplication, division, square and squareroot (these methods have been previously created and must be implemented in the program.)

The major issue I am having with the program is how to get it to properly read and evaluate the expression while following all guidelines. I'm not really sure where to go from here as I am new to programming in Java.

import java.util.*; public class Calculator{ public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String userInput; ArrayList<Double> opperands = new ArrayList<Double>(); ArrayList<Character> operator = new ArrayList<Character>(); System.out.println("Enter equation:"); userInput = scnr.nextLine(); s = s.replaceAll(" ", ""); if (s.equalsIgnoreCase('quit')) { break; } else { for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '+' || s.charAt(i) == '-' || s.charAt(i) == '*' || s.charAt(i) == '/' || s.charAt(i) == '^' || s.charAt(i) == '|'){ operator.add(s.charAt(i)); } else if ((!Character.isDigit(s.charAt(i)) { opperands.add(s.charAt(i)) } } } //1. when quit is entered program will stop otherwise will continue //2. read user input and parse at new line //3. must be able to read mathmatical equation //4. must handle parenthesis //5. must have order of presidence //6. once parsed use methods in calculations.java //7. return result //8. if non computable return error } }