COMP 110-001: Introduction to Programming, SSI'15
TIPS for Homework 2: GUI Calculator
- You will be able to read in a String from the user input by using something like this:
inputString = JOptionPane.showInputDialog("Please Enter a string:");
- Once you have an input String you need to parse the string (split your string into groups of characters, like what we did in Lab 2) into operand1, operator, and operand2
- Use your String methods (p. 86) to parse your String into operand1, operator, and operand2
- You can convert a String to different types (see Figure 2.9 on p. 123)
- To format your output, you can use the format method provided in the class String.