import java.util.Scanner; import javax.swing.JOptionPane; /* This is a test class for tha Triangle Analyzer class. Make no changes to * this class other than adding the required statements in the TO DO section, * below. */ public class TriangleTester { public static void main(String[] args) { String input = JOptionPane.showInputDialog( "Enter the lengths of the 3 sides of the first triangle, " + "separated by spaces\n(or click Cancel to quit)"); while (input != null) { Scanner inputScan = new Scanner(input); int side1 = inputScan.nextInt(); // length of first side int side2 = inputScan.nextInt(); // length of second side int side3 = inputScan.nextInt(); // length of third side // TO DO: // 1. Create a Triangle Analyzer object using side1, side2, // and side3 // // 2. Call the accessor mathods to get the lengths of the sides // and print them // // 3. Call the method that returns the type of triangle (or an // appropriate message if the sides do not form a triangle) // and print it // // 4. If the side lengths do form a triangle, call the method that // computes and returns the area and print it, rounded to 2 // decimal places input = JOptionPane.showInputDialog( "Enter the lengths of the 3 sides of the next triangle, " + "separated by spaces\n(or click Cancel to quit)"); } } }