Problem Statement As part of an artillery simulation, the military would like to simulate the trajectory of a shell launched by a howitzer gun. The formulas needed for computing the trajectory of any projectile are: t= d v×cos h=v×sin×t−g×t2 2 where d is distance to the target in feet, v is the projectile velocity in feet/sec, is the launch angle of elevation in radians, t is time of flight of the projectile to the target distance in seconds, g is the Earth's gravitational constant in feet/sec2, and h is the height of projectile in feet when it reaches the target distance. Assignment Write a Python program that repeatedly asks the user for the distance to a target. Then it should ask for the angle of elevation of the shell being launched in degrees (since most people deal with angles in degrees rather than radians) and the velocity of the shell. The program is to compute the height of the shell when it reaches the target's distance and display this result. Since the transcendental functions in the Python math library receive their angle argument in radians, the user input will need to be converted. The formula for converting degrees into radians is: radians= 180 ×degrees Your program must define and use at least two functions: • computeShellHeight(distanceToTarget, angleInDegrees, shellVelocity) this function receives the distance to the target, the angle of elevation in degrees, and the velocity of the shell, and returns the shell's height at the target's distance. • main() this function encompasses the main program. It should have the main input loop that repeatedly asks the user a distance to a target, the angle of elevation in degrees, and the shell velocity, then computes and displays the height of the shell at the target distance. It should use the other function directly. Your program must interact with the user in exactly the manner shown on the back page (user input shown in bold), stopping when the user enters 0 for the distance to the target. Coding Notes ● Use 3.1415926 for the value of and 32.17 for g. ● The transcendental functions (sine, cosine) are in the math module. To use them, put import math at the top of the program file and prefix each math function with "math.", so the names of the functions are math.sin and math.cos ● The format specifier to get the output to have only one decimal place is %.1f 09/05/2014 Page 1 of 2 D. Hwang SHELL TRAJECTORY CALCULATOR Enter the distance to the target in feet (0 to quit): 6000 Enter the launch angle of elevation in degrees: 11.12 Enter the velocity of the shell in feet/sec: 1847 The height of the shell at the target's distance is 1003.0 feet Enter the distance to the target in feet (0 to quit): 5000 Enter the launch angle of elevation in degrees: 10.75 Enter the velocity of the shell in feet/sec: 1847 The height of the shell at the target's distance is 827.2 feet Enter the distance to the target in feet (0 to quit): 6000 Enter the launch angle of elevation in degrees: 11.5 Enter the velocity of the shell in feet/sec: 1847 The height of the shell at the target's distance is 1043.9 feet Enter the distance to the target in feet (0 to quit): 0 All done How to Submit This process will be demonstrated on Friday in class. The submission system will not be ready to accept assignments until then. First, write a comment (lines starting with #) at the top of the program file with your name and the phrase "CS 101 Homework 1" with exact spacing, capitalization and spelling. This will be used to make sure you submit the correct program file. Save your program file and make sure it still runs. In a web browser, go to URL submission.evansville.edu. Your login name is your ACENET username (unless you also are in CS 210, then your login name has "cs101" appended to it). Your initial password is your student ID with the leading 0. It is recommended that you change your password. Click on the Submit Solution link for Homework 1, then click on the Browse button. Browse to your Homework 1 program file. Rightclick on the program file, select Send to, then select Compressed (zipped) folder. Doubleclick on the ZIP folder, then click on the Submit button. (Mac users will need to compress their file before browsing to find it.) The submission system first checks that the submitted file has a ".py" extension, and will fail if the extension is missing. Then it checks for the "CS 101 Homework 1" comment. It must be exactly as shown including spacing, capitalization and spelling. If this comment is not found, the submission will fail. Correct the comment, save the program file, then zip and submit it again. 09/05/2014 Page 2 of 2 D. Hwang