Whats wrong with this please help me im about to lose my mind.
Updated it.Code:import java.util.Scanner; //Scanner Object. /** * @(#)DistanceTraveled.java * * DistanceTraveled application * * @author * @version 1.00 2013/3/15 */ public class DistanceTraveled { public static void main(String[] args) { //Declare Variables int speed; int hours; int distance; //Create a Scanner Object Scanner keyboard = new Scanner(System.in); //Accept user input System.out.print("What is the speed of the vehicle?"); speed = keyboard.nextInt(); System.out.print("What is the hours it has traveled?"); hours = keyboard.nextInt(); distance = speed * hours; //Display the table System.out.println("Hours Distance Traveled"); System.out.println("-----------------------"); for (int houR = 1; Distance <= distance; Hour++ ); { System.out.println(houR + "\t\t" + houR * distance); } } }
Results 1 to 8 of 8
Thread: Help?
Threaded View
- 16 Mar. 2013 12:42am #1
- Age
- 97
- Join Date
- Nov. 2009
- Location
- In the computer
- Posts
- 11,186
- Reputation
- 1029
- LCash
- 0.25
- Awards
Help?
Last edited by Taz; 16 Mar. 2013 at 12:52am.