A motorcycle stuntman is planning a sensational Jump
across a river gorge. He has asked you to help set up the jump by
calculating the outcome of various take-off speeds and angles. The
gorge is 400 feet across ( a new world record!) and 50 feet deep.
He plans to erect a take-off ramp that ends 20 feet directly above
the rim of the gorge. He plans to jump on a windless
day.
To solve this problem, we’ll assume that the air drag is
proportional to speed. This allows us to derive two equations from
our knowledge of physics that we can use to calculate the position
of the cycle as a function of time (t). We’ll let x represent the
horizontal distance traveled and y the vertical distance
traveled:
X= (V_o cos(A))/k (1 - e^-kt)
Y= (-gt / k) + (1 / k) (v_o sin (A) + (g/k)) (1 -
e^-kt)
Where g is the constant acceleration due to gravity
(32.2 ft/s/s),
And k is the air drag constant of proportionality (0.154
s^-1),
And A is the angle of take-off from the ramp
(radians),
And v_0 is the take-off speed from the ramp
(ft/s),
Program Requirements:
1). Name your source file
FPLastnameFirstname.cpp
2). Write a function inputValues() that prompt the user
for the take-off speed in mph and take-off angle in
degrees.
3). Output to the screen a table of values with three
columns. The column headers are time(s), x-distance(ft), and
y-distance(ft), where the x-distance is the horizontal distance
from the end of the ramp, and the y-distance is the height above
the rim. Calculate values at intervals of 0.5 seconds, starting at
time t = 0. Begin the table with a statement that echoes the input
values (labeled appropriately). Stop the table when you can decide
wether or not the bike makes it across the gorge.
4). Write and use two very simple
functions:
a). xcalc() - pass to it time and both input values, and
have it return the values of x at the given time.
b). ycalc() - pass to it time and both input values, and
have it return the value of y at the given time.
Call these functions whenever you need to calculate x
and y. Define g and k as global constants so you won’t need to pass
them to these functions.
5). Output to the screen the outcome: does the bike make
it across the gorge, or does it crash into the gorge?
Test your program with the following three test
runs:
V_o = 110 mph and A = 45 degree
V_o = 90 mph and A = 45 degree
V_o = 100 mph and A = 40 degree
A motorcycle stuntman is planning a sensational Jump across a river gorge. He has asked you to help set up the jump by c
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
A motorcycle stuntman is planning a sensational Jump across a river gorge. He has asked you to help set up the jump by c
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!