Question: I don't know why the value for the max height and time to max height are switched. I also need it to print the value


I don't know why the value for the max height and time to max height are switched. I also need it to print the value for total distance as well.
The correct values should be : Time to max height: 3.80 max height reached: 170.79 time to ground: 9.7 Total distance: 626.15
#include #include double degreeInput(); double timeMax Height(); double heightMax(); double timeGround(); double distanceTotal(); double inputHeight(); double velocityInput(); void output(); int main() { double degree; double velocity; double height; double timeMax; double ground; double maxHeight; double totalDistance; 1 2 3 4 5 6 7 8 9 19 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 inputHeight(); velocityInput(); degreeInput(); degree = degreeInput(); velocity = velocityInput(); height = inputHeight(); timeMax Height(); timeMax = timeMaxHeight(velocity, degree); heightMax(); maxHeight = heightMax(timeMax, velocity, height, degree); timeGround(); ground = timeGround(velocity, height, degree); distance Total(); totalDistance = distanceTotal(timeGround, velocity, degree); output(ground, timeMax, maxHeight); return; } } double degreeInput() { double degree; degree = 30; //printf(" Enter angle to the horizontal (Degrees]: "); //scanf("%.11", °ree) return (degree); } double velocityInput() { double velocity; velocity = 74.5; //printf(" Enter initial velocity [m/s]: "); //scanf("%.1f", &velocity); return (velocity); } double inputHeight() { double height; height =100; //printf(" Enter height of launch [m]: "); //scanf("%.1f", &height); return height; } doubl. Mwuabudouble vlacity double doorool return 0; } 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 double degreeInput() { double degree; degree = 30; //printf(" Enter angle to the horizontal (Degrees] : "); //scanf("%.1f", °ree) return (degree); } double velocityInput() { double velocity: velocity = 74.5; //printf(" Enter initial velocity [m/s]: "); //scanf("%.1f", &velocity); 58 return (velocity); } double inputHeight() { double height; height =100; //printf(" Enter height of launch [m] : "); //scanf("2.17", &height); return height; } double timeMaxHeight(double velocity, double degree) { double timeMax: timeMax = velocity * sin(degree * (M_PI/180))/ 9.8; 59 60 61 62 63 64 65 66 67 6B 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 98 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 return timeMax: } double timeGround (double velocity, double height, double degree) { double ground; ground = (velocity * sin(degree * M_PI/180) + sqrt(pow((velocity * sin(degree * M_PI/180)), 2) + 2 * (9.8) * height))/9.8; return ground; } double heightMax(double timeMax, double velocity, double height, double degree) { double maxHeight; maxHeight = height + velocity * sin(degree * (M_PI/180)) * timeMax - 0.5 * 9.8 * powtimeMax, 2); return maxHeight; } double distance Total(double ground, double velocity, double degree) { double totalDistance; ; totalDistance = velocity * cos(degree * M_PI/180) * ground; return totalDistance; } void output (double ground, double maxHeight, double timeMax) { printf(" -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- "); printf(" Time to max height: 4.2f ", timeMax); printf(" Maximum height reached reached: %.2f ", maxHeight); printf(" Time to hit ground: %.2f ", ground); return; } -=-=-=-=-=-=-=-=-=-=-=-=-= Time to max height: 170.79 3.80 Maximum height reached reached: Time to hit ground: 9.70 [Finished in 0.5s]