Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C Programing - General Preprocessing items: Use mnemonic variables of 3 characte

ID: 643846 • Letter: C

Question

C Programing

- General Preprocessing items: Use mnemonic variables of 3 characters or more. Use void main (void) or void main ( ) in your program and leave off the return 0. Use double as the choice for all floating point values. Add heading items using as printf statement. Watch for instructions that specify a symbolic constant and assign that symbolic constant in all capital letters and using the #define.

Problem:
Write a program that calculates the distance from the roof top to the ground for a free falling ball that is only influenced by gravity as it falls. The program should ask the user to input the height of the building. It is great weather on the roof, so the initial velocity is 0 meter / second. This gives a distance equation shown below and a Velocity equation shown below. The program should assign the value of gravity as a symbolic constant. Gravity = 9.81 meters / seconds-squared. The program must use the built in function(s),such as pow and or sqrt, from the Math header file (library) to calculate values. The program should calculate the time and print the answer to show 5 decimal place(s). The program should calculate the velocity and print the answer to show 4 decimal place(s). The program lets the user know how many valid tries and how many error tries were completed. The program continues until it is told to stop when -999 is entered. Use the given data and reproduce the sample output as a comment in your program.

(use the following filename system: lastname_gravity_firstinitial.c) a ut problan3 - Scenario 1 (Heading goes here) Calculate the time it would take for a golf ball to fall from a building from a given height. Enter the height of the building in meters or enter -999 to stop: -99 Error, Error: The height must be greater than 0. You entered -99 Enter the height of the building in meters or enter -999 to stop: -999 Thank you for using our program. You had 0 valid attempt(s) and 1 error attempt(s). Please come again. Press any key to continue sample output problem3 - Scenario 2 (Heading goes here) Calculate the time it would take for a golf ball to fall from a building from a given height. Enter the height of the building in meters or enter -999 to stop: 100 The Time of the fall = xxxxx seconds The Velocity of the golf ball = max meters/second Enter the height of the building in meters or enter -999 to stop: 18.4 The Time of the fall = max seconds The Velocity of the golf ball = xxxxx meters/second Enter the height of the building in meters or enter -999 to stop: -1 Error, Error: The height must be greater than 0. You entered -I Enter the height of the building in meters or enter -999 to stop: -998 Error, Error: The height must be greater than 0. You entered -998 Enter the height of the building in meters or enter -999 to stop: -999 Thank you for using our program. You had 2 valid attempt(s) and 2 error attempt(s). Please come again. Press any key to continue sample output problcm3 - Scenario 3 (Heading goes here) Calculate the time it would take for a golf ball to fall from a building from a given height. Enter the height of the building in meters or enter -999 to stop: -999 Thank you for using our program. You had 0 valid attempt(s) and 0 error attempt(s). Please come again. Press any key to continue

Explanation / Answer

#include<stdio.h>

#include<conio.h>

#include<math.h>

#define G 9.81

void main()

{int val=0,err=0;

Double height ,velocity,time,temp;

printf(