C PROGRAMMING

profileaber.al1

Assignment objectives:

-          User Defined Functions

 

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:

 

 

Description: Formula for Trajectory of Projectile Motion

 

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

 

General requirement

1-     Following comments must be the first lines of your source code

/* -----------------------------------------------

         Submitted By: <Your Name>

         Homework Number: <whichever homework you are doing>

         Credit to:

                             <Name or names>

 

         Submitted On: <Date>

 

          By submitting this program with my name,

          I affirm that the creation and modification

                 of this program is primarily my own work.

 ------------------------------------------------ */

2-      Next few line of your source code must be comments describing what this program is supposed to do.

3-      The first output (display) must be your name

4-      The source code file must include comments documenting the design.

5-      Indentation and spacing should be used to make the program readable.

 

Deliverables:

No hard copy is needed; submit the soft copy of your source code (the .c file) to blackboard

 

IMPORTANT: You must name your source code as below:

 

Yourusername_homeworknumber_cs223

  • 8 years ago
  • 40
Answer(4)

Purchase the answer to view it

blurred-text
NOT RATED
  • attachment
    solution.zip

Purchase the answer to view it

blurred-text
NOT RATED
  • attachment
    trajectory.zip

Purchase the answer to view it

blurred-text
NOT RATED

Purchase the answer to view it

blurred-text
NOT RATED
Bids(0)