Assignment Task

Your task is to design and develop software for projectile motion to calculate the magnitude of the displacement (m) and find the maximum range of the projectile (m), where the initial velocity (m/s) is specified by the user.

Equations

In the following equations, x is the horizontal displacement, y is the vertical displacement, v is the initial velocity, O is the angle of projection and g is the acceleration due to gravity (9.8 ms-2). At any time , the displacement components are:

Equation 1: see image.

Equation 2: see image.

The equation for the magnitude of the displacement is:

Equation 3: see image.

The horizontal displacement of the projectile is called the range of the projectile, and depends on the initial velocity of the projectile and the angle of projection. The range of the projectile (R) is:

Equation 4: see image.

  • The angle of projection should start at 15 degrees and increment by 15 degrees until 90 degrees.
  • Your program should show the displacement at 10 seconds interval, over a 50 seconds period for different angle of projectile.
  • Your program should find out at which projectile angle, range of the projectile will be maximum.

To do this and obtain a pass mark, your solution will, at a minimum, need to:

  • accept only valid input from the user:
    • The initial velocity must be greater than 0.
  • Display the result in 3 column format as shown in Figure 1 with projectile angle, time and magnitude of displacement.
  • Display a message indicating the maximum range reached for which angle of projectile.
  • Use appropriate modularisation, sequence, selection and repetition structures to simplify the design and execution of your solution. You must use at least two different iteration structures and one nested repetition structure.
  • Use appropriate identifier names and thoroughly document your code.

For maximum marks, you must excel in this task, enhancing the program's functionality, useability or elegance using relevant sequence, selection and repetition structures. Consider enhancing your solution by:

  • Using modularisation to improve code coherence in main().
  • Use programming structures to improve the useability of the basic solution.
  • Use programming structures to add user-customisable features to the basic solution.
  • Improving the reliability and efficiency of your solution, ensuring that it allows efficient checking (proof of correct functionality).
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.