String firstNumber; // first string entered by user String secondNumber; // second number entered by user String thirdNumber; // third number entered by user

int number1; // first number int number2; // second number int number3; third number

int average; // average of the numbers int largest; // largest number int product; // product of the numbers int smallest; // smallest number int sum; // sum of the numbers

// read in first number from user as a string firstNumber = JOptionPane.showInputDialog( "Enter first integer");

// read in second number from user as a string secondNumber = JOptionPane.showInputDialog( "Enter second integer" );

// read in third number from user as a string thirdNumber = JOptionPane.showInputDialog( "Enter third integer" );

// convert numbers from type String to type int number1 = Integer.parseInt( firstNumber ); number2 = Integer.parseInt( secondNumber ); number3 = Integer.parseInt( thirdNumber );

// initialize largest and smallest largest = number1; smallest = number2;

// determine smallest and largest if (number1 > number2) result = "The largest is " + number1; else if ( number2 < number1) result = "The smallest is " + number2;

// create result string String result; if ( sum = number1 + number2 + number3) result = "The sum is + sum" ; if ( product = number1 * number2 * number3) result = "The product is + product"; if ( average = (number1 + number2 + number3) / 3) result = "The average is + average";

// display results JOptionPane.showMessageDialog( null, result, "Calculation Results", "The largest is " + largest + "\nThe smallest is " + smallest + "\nThe sum is " + sum + "\nThe product is " + product + "\nThe average is " + average, "Results", JOptionPane.PLAIN_MESSAGE ); } }

String firstNumber; // first string entered by user String secondNumber; // second number entered by user String thirdNumber; // third number entered by user

int number1; // first number int number2; // second number int number3; // third number

int average; // average of the numbers int largest; // largest number int product; // product of the numbers int smallest; // smallest number int sum; // sum of the numbers

// read in first number from user as a string firstNumber = JOptionPane.showInputDialog( "Enter first integer" );

// read in second number from user as a string secondNumber = JOptionPane.showInputDialog( "Enter second integer" );

// read in third number from user as a string thirdNumber = JOptionPane.showInputDialog( "Enter third integer" );

// convert numbers from type String to type int number1 = Integer.parseInt( firstNumber ); number2 = Integer.parseInt( secondNumber ); number3 = Integer.parseInt( thirdNumber );

// initialize largest and smallest largest = number1; smallest = number2;

// determine smallest and largest if (number1 > number2) result = "The largest is " + number1; else if ( number2 < number1) result = "The smallest is " + number2;

if ( sum == number1 + number2 + number3) result = "The sum is + sum" ; if ( product == number1 * number2 * number3) result = "The product is + product"; if ( average == (number1 + number2 + number3) / 3) result = "The average is + average";

// display results JOptionPane.showMessageDialog( null, result, "Calculation Results", "The largest is " + largest + "\nThe smallest is " + smallest + "\nThe sum is " + sum + "\nThe product is " + product +

"\nThe average is " + average, "Results", JOptionPane.PLAIN_MESSAGE ); } } -------------------------------------------------

The error that i'm getting now is as follows:

Calculate2.java:43: cannot find symbol symbol : variable result location: class Calculate2 result = "The largest is " + number1; ^ Calculate2.java:45: cannot find symbol symbol : variable result location: class Calculate2 result = "The smallest is " + number2; ^ Calculate2.java:63: cannot find symbol symbol : method showMessageDialog(<nulltype>,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int) location: class javax.swing.JOptionPane JOptionPane.showMessageDialog( null, result, "Calculation Results", "The largest is " + largest + ^ 3 errors

I know it's something rather simple, but i'm stuck on this one.

[ September 24, 2006: Message edited by: Derek Harper ]

[ September 24, 2006: Message edited by: Derek Harper ] [ September 24, 2006: Message edited by: Derek Harper ]