Question: use c to program the whole thing max height = g*time? Problem: Given as input the initial height, velocity, and angle (to the horizontal) of



use c to program the whole thing
max height = g*time? Problem: Given as input the initial height, velocity, and angle (to the horizontal) of a projectile being launched calculate the time to reach maximum height, the maximum height reached, the time to hit the ground, and the total distance traveled. All values input and output are of the double data type. A good use of user-defined functions is a requirement of this and all future programming assignments. Time to reach max height: Maximum height reached: initial velocity*sin (0) time height=initial velocity*sin ()*time- 9.8 max height Time to hit ground: Assumptions: 1. The acceleration due to gravity is 9.8 m/s is - height=initial velocity*sin ()*time hit ground downward and constant over the range of motion. Total distance traveled: 2. Air resistance/friction is not to be considered, making the horizontal component distance=initial velocity*cos(0)*time hit ground of acceleration constant. 3. Earth's rotation does not affect the motion. Example Execution #1: Enter height of launch [m] -> 100 Enter initial velocity [m/s] => 74.5 Enter angle to the horizontal (degrees] => 30 s g*time mit ground Time to max height: Maximum height reached: Time to hit ground: Total distance traveled: 3.80 S 170.79 m 9.70 S 626.15 m All course programming and documentation standards are in effect for this and each assignment this semester. Please review this document! Example Execution #2: Enter height of launch [m] => 100 Enter initial velocity [m/s] -> 75.15 Enter angle to the horizontal [degrees] -> 60 -=-=-= =-=- Academic Integrity Reminder: Time to max height: Maximum height reached: Time to hit ground: 6.64 s 316.10 m 14.67 s 551 33 m Please review the policies of the course as they relate to academic integrity. The Total distance traveled. Time to max height: Maximum height reached: Time to hit ground: Total distance traveled: 6.64 S 316.10 m 14.67 s 551.33 m =-=- Academic Integrity Reminder: Please review the policies of the course as they relate to academic integrity. The assignment you submit should be your own original work. You are to be consulting only course staff regarding your specific algorithm for assistance. Collaboration is not permitted on individual homework assignments. Example Execution #3: Enter height of launch [m] => 0 Enter initial velocity [m/s] => 135 Enter angle to the horizontal [degrees] -> 45 Time to max height: Maximum height reached: Time to hit ground: Total distance traveled: 9.74 s 464.92 m 19.48 s 1859.69 m Additional Requirements: 1. Add the homework assignment header file to the top of your program. A description of your program will need to be included in the assignment header. This particular header can be added to your file by entering hhw while in command mode in vi. 2. Each of the example executions provided for your reference represents a single execution of the program. Your program must accept input and produce output exactly as demonstrated in the example executions, do not add any bonus features not demonstrated in the example executions. Your program will be tested with the data seen in the example executions and an unknown number of additional tests making use of meaningful data. All data input, output, or generated in the process of calculating the results displayed are assumed to be of the double data type. 3. For this assignment you will be required to implement the user-defined functions (from chapter 4). Failing to follow course standards as they relate to good user-defined function use will result in a zero for this assignment. o 3. For this assignment you will be required to implement the user-defined functions (from chapter 4). Failing to follow course standards as they relate to good user-defined function use will result in a zero for this assignment. 4. Revisit course standards as it relates what makes for good use of user-defined functions, what is acceptable to retain in the main function, and when passing parameters by address is appropriate. In many cases user-defined function use should result in a main function that only declares variables and makes function calls. 5. Course standards prohibit the use of programming concepts not yet introduced in lecture. For this assignment you can consider all material in the first four chapters of the book, notes, and lectures to be acceptable for use. 6. A program MUST compile to be considered for partial credit. The submission script will reject the submission of any file that does not successfully compile on the guru server. The name of the source code file you attempt to submit must be hw03.c, no variation is permitted. Course Programming and Documentation Standards Reminders: Use the course function header (head_fx vi shortcut hfx while in command mode) for every user-defined function in your program. List and comment all parameters to a function, one per line, in the course function header. All function declarations will appear in the global declaration section of your program. The user-defined function definitions will appear in your program after the main function. Indent all code found within the main function exactly two spaces. Place a single space between all operators and operands. Comment all variables to the right of each declaration. Declare only one variable per line. In general it is acceptable to initialize a variable declared in the local declaration section of a function. If the expression used to initialize the variable is more complex than a constant assignment then it is best to give the variable its first value inside of the executable statement section of the function. Notice that several programs (see program 2-9 on pages 74-75) in the programming text use a single line comment to indicate the start of the local declaration and executable statement sections of the main function. At no point during the semester should these two sections ever overlap. Select meaningful identifiers (names) for all variables in your program. Do not single (or double) space the entire program, use blank lines when appropriate. When you submit... only the final successful submission is kept for grading. All other submissions are over-written and cannot be recovered. You may make multiple submissions but only the last attempt is retained and graded. Verify in the confirmation e-mail sent to you by the course that you have submitted the correct file (must be named hw03.c), to the correct assignment (hw03), and to the correct section. Leave time prior to the due date to seek assistance should you experience difficulties completing or submitting O Leave time prior to the due date to seek assistance should you experience dificulties completing or submitting this assignment. All attempts to submit via a method other than through the guru server as set up in the Account Configuration Activity will be denied consideration. Assignment deadlines... are firm and the electronic submission will disable promptly as advertised. We can only grade what you submit as expected prior to the assignment deadline. . Auto-Grade Tool We have implemented what is being referred to as the auto-grade tool. At the time of a successful assignment submission you may receive some feedback on your program in regards to course programming and documentation standards. This feedback may include a potential deduction that you will receive once your assignment is reviewed by your grader. It is expected that graders verify those notes identified by this tool to ensure that they are indeed applicable and reasonable to the submission. Graders may make additional deductions for those standards not identified by the new tool. We hope that this feedback helps with the enforcement of course standards, consistency in grading across sections, and to encourage students to revise their work when problems are identified before the assignment deadline passes. It is possible to resubmit an assignment for grading up to the advertised deadline. Only the final successful submission is retained and evaluated
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
