Proxy > Gmail Facebook Yahoo!

28. The distance traveled by a vehicle in t seconds is given by u, a



import java.util.*;
public class CalculateDistance {
 
 
  public static void main(String[] args)
  {
    Scanner scan=new Scanner(System.in);
    System.out.print("Enter Value of intial velocity (u):");
    int u=scan.nextInt();
    System.out.print("Enter Value of acceleration (a):");
    int a=scan.nextInt();
    System.out.print("Enter Value of Time interval(t):");
    int t=scan.nextInt();
    double distance=u*t +(a*t)*(a*t)/2.0;
    System.out.println("Distance ="+distance);
  }
 
}


Responses

0 Respones to "28. The distance traveled by a vehicle in t seconds is given by u, a"


Send mail to your Friends.  

Expert Feed

 
Return to top of page Copyright © 2011 | My Code Logic Designed by Suneel Kumar