The final velocity of a vehicle ca be calculated by using formula: v2=u2+2as; where u=initial velocity, v=final velocity, a=acceleration, s=distance covered. Write a program in Java to calculate and display the final velocity by taking initial velocity, acceleration and distance covered as inputs
write accurately
Answers
Answered by
3
Answer:
Explanation:
import java.util.*;
class Test
{
public static void main()
{
Scanner sc = new Scanner(System.in);
System.out.println ("Enter the initial velocity: ");
int u = sc.nextInt();
System.out.println ("Enter the acceleration: ");
int a = sc.nextInt();
System.out.println ("Enter the distance covered: ");
int s = sc.nextInt();
int v = Math.sqrt((Math.pow(u, 2) + 2*a*s));
System.out.print ("\nThe final velocity is: "+v);
}
}
Similar questions