Question: When a projectile is launched at an angle theta to the horizontal with an initial velocity V , its motion can be described by
When a projectile is launched at an angle theta to the horizontal with an initial velocity V its
motion can be described by the following equations where the angle is measured in radians:
Maximum height HV sintheta g where g is the acceleration due to gravity
approximately ms on Earth
Total flight time T V sintheta g
Horizontal range RV sintheta g
Write a JAVA program that asks the user for the initial velocity and launch angle. Validate that the
initial velocity is positive and that the angle is between and loop until these are valid
Then calculate and print the three values above.
NOTE: use Java constants for g and for the conversion from degrees to radians which is
equal to To calculate a sin in Java, use Math.sinx and to square a value, use either
xx or Math.powx sintheta is the same as sintheta sintheta
Limit output to one decimal see sample output
SAMPLE OUTPUT:
Welcome to the Projectile Motion Calculator!
Enter the initial velocity in meters per second:
Initial velocity must be a positive value.
Enter the initial velocity in meters per second:
Enter the launch angle in degrees:
Launch angle must be between and degrees.
Enter the launch angle in degrees:
Launch angle must be between and degrees.
Enter the launch angle in degrees:
Results:
Maximum height: meters maximum height
Total flight time: seconds
Horizontal range: meters
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
