Question: How do you solve this? Problem 2: Throw Height Submit file: assign1p2.cpp Again, when you setup the project for this problem, use assign1p2 for the
Problem 2: Throw Height Submit file: assign1p2.cpp Again, when you setup the project for this problem, use assign1p2 for the Project Name. If you need to rename your code file, make sure to update your Makefile See here for how to successfully rename a.cpp file. The height h in meters an object will reach if it is thrown straight up depends on its initial velocity V in meters/second and the force of gravity g in meters/second.g varies depending on what planet/body you are on. On Earth, g is 9.8m/s; on Mars, 3.7m/s, on the Moon, it is 1.6m/s. Write a program that asks the user for an initial velocity and the force of gravity and uses this formula to calculate the height a thrown object will reach. h-V You do NOT have to worry about how many decimal places your answer prints to Sample run 1: (user input in red) Enter the velocity in m/s 28 Enter a value for 9 in 8/21 9.8 It will reach 20.4082 meters Sample run 2: (user input in red) Enter the velocity in m/s 12.5 Enter a value for g in m/s^2: 24.8 It will reach 3.1582 meters Hint: If you want to use the pow function to square V, you will need to put #include near the top of your file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
