It compiles right with exit code 2 no errors..Yes this is for a class but it is online and it's difficult for her to get back to us. Also, where can I find out what the exit codes stand for. Any help would be great. Thanks
import java.util.Scanner;
public class ErikKnoxProg4
{
public static void main(String[] args)
{
Scanner stdln=new Scanner(System.in);
double speed, distance, stoppingDistance; //formula numbers
System.out.print("Enter your speed (in mph):"); //Print and wait for response
speed = stdln.nextDouble();
System.out.print("Enter your tailgate distance (in feet):");//print and wait for response
distance = stdln.nextDouble();
stoppingDistance = speed * (2.25 + speed / 21);//Process the user input
if (stoppingDistance > distance)
{
System.out.println("Major wreck!");
}
else if (stoppingDistance == distance)
{
System.out.println("Minor wreck.");
}
else
{
System.out.println("No problem.");
}
}//end if
}//end main
Where have I gone wrong
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact: