ESimon1
Nov 25th, 2006, 03:13 PM
ok.. here's the code I wrote. There's no errors or anything but i need to know how to input the Vehicle's speed. "Enter 0 or greater for speed =40" "Enter the number of hours the Vehicle was in motion" and "Enter the 1 or greater for hours' to the black thing after i run it.. here's my code so far...
/**
This program demonstrates the for loop.
*/
public class DistanceTraveled
{
public static void main(String [] args)
{
int number; // Loop control variable
System.out.println("Hour Distance Traveled");
System.out.println("-----------------------");
for (number = 1; number <= 3; number++)
{
System.out.println(number + "\t\t" +
number * 40.0);
}
}
}
/**
This program demonstrates the for loop.
*/
public class DistanceTraveled
{
public static void main(String [] args)
{
int number; // Loop control variable
System.out.println("Hour Distance Traveled");
System.out.println("-----------------------");
for (number = 1; number <= 3; number++)
{
System.out.println(number + "\t\t" +
number * 40.0);
}
}
}