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 (H)=(V2* sin2(\theta ))/(2* g), where g is the acceleration due to gravity
(approximately 9.81 m/s^2 on Earth).
- Total flight time (T)=(2* V * sin(\theta ))/ g.
- Horizontal range (R)=(V2* sin(2*\theta ))/ 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 0 and 90(loop until these are valid).
Then calculate and print the three values above.
NOTE: use Java constants for g =9.81 and for the conversion from degrees to radians which is
equal to 0.0174533. To calculate a sin in Java, use Math.sin(x) and to square a value, use either
x*x or Math.pow(x,2). sin2(\theta ) is the same as sin(\theta )* sin(\theta ).
Limit output to one decimal (see sample output)
SAMPLE OUTPUT:
Welcome to the Projectile Motion Calculator!
Enter the initial velocity (in meters per second): -20
Initial velocity must be a positive value.
Enter the initial velocity (in meters per second): 30
Enter the launch angle (in degrees): 110
Launch angle must be between 0 and 90 degrees.
Enter the launch angle (in degrees): -2
Launch angle must be between 0 and 90 degrees.
Enter the launch angle (in degrees): 45
Results:
Maximum height: 23 meters maximum height
Total flight time: 4.3 seconds
Horizontal range: 91.8 meters

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!