Question: Write a Java program with a Graphical User Interface (GUI) that calculates how far a ball thrown at a given speed and angle will travel.
Write a Java program with a Graphical User Interface (GUI) that calculates how far a ball thrown at a given speed and angle will travel. The program should ask the user for the angle the ball will be thrown in degrees and the speed in feet per second. The distance a ball will travel can be calculated by speed sin(2 angle) distance- where g is the gravitational acceleration of 32.174 ed Note that the angle given by the user in degrees must be converted to radians for the Java Math class by radians degrees /180 feet sec2 You are free to format the GUI in any way that works effectively. Example formats are: Enter angle 35 Enter speed 30 Throw ball will hit at 26.285925241105165 Enter angle 45 Enter speed 30 . Throw ll will hit at 27.9728973705476
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
