icompatible types

When i debug this i get the incompatable types error where the ^ are

I know there are more errors than that but its just this is the first problem and the double thing i think its worn i was just trying different float and integer types and that is when i got fed up

//SLOPE

import java.io.*;

publicclass SLOPE{

publicstaticvoid main(String args [ ]){

String one;

String two;

String three;

String four;

double rise, run, slope;

BufferedReader reader;

reader =new BufferedReader(new InputStreamReader(System.in));

System.out.print("\nThe first x = ");

try{

one= Double.parseDouble(reader.readLine( )) ;

^

System.out.print("The first y = ");

two = Double.parseDouble(reader.readLine( )) ;

^

System.out.print("The second x = ");

three= Double.parseDouble(reader.readLine( )) ;

^

System.out.print("The second y = ");

four = Double.parseDouble(reader.readLine( )) ;

^

rise = (four - three);

run = (two - one);

slope = (rise / run);

}

catch (IOException ioe){

System.out.println("Error");

}

catch (NumberFormatException nfe){

System.out.println("Error");

}

System.out.println("the rise = " + rise) ;

System.out.println("the run = " + run );

System.out.println("the slope = " + slope);

reader.close( );

}

}

[2382 byte] By [Our_Nationa] at [2007-10-1 3:53:23]
# 1

You have the following code

String one;

one= Double.parseDouble(reader.readLine( )) ;

However parseDouble produces a double not a String.

Correct the type of one, two, three, four to be double.

BTW: You should also give them meaningful names. Counting names are bad choices for names.

Peter-Lawreya at 2007-7-8 22:45:23 > top of Java-index,Archived Forums,Debugging Tools and Techniques...