Write a program to calculate the trajectory of a cannon


Write a program to calculate the trajectory of a cannon ball (we use a watermelon). The program must ask the user for the initial velocity and initial trajectory angle then ask the user what they want to calculate, Time of flight or Max. height or horizontal range. Calculate what user wants and display it.

Formulas:

User input:

The initial velocity valid rage is 10 to 1000 m/s

The initial angle valid range is 1 to 89 degrees

Requirement

Must implement functions for each of the followings:

1. Calculating peak height. Must not print the result in the function

2. Calculating max range. Must not print the result in the function

3. Calculating travel time. Must not print the result in the function

4. Check for valid input from the user and give the user chance to reenter the data 3 times, after 3 incorrect tries give user a notice and exit the program. You can do some print statements in this function depending on how you design your code

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program to calculate the trajectory of a cannon
Reference No:- TGS01133619

Now Priced at $60 (50% Discount)

Recommended (97%)

Rated (4.9/5)