Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A ball is thrown up in the air. Its height above the ground is given by the formula h = 3 + 10t – t2 where t is the time in seconds after it is thrown. For example, at
- Time t = 0, h = 3 + 0 - 0 = 3
- Time t = 2, h = 3 + 20 – 4 = 19
- When the ball hits the ground, h becomes negative. Write a fragment of C++ code to print out the height, h, once every second, starting a t = 0, and continuing until h becomes negative (meaning the ball has hit the ground). (Do not print the negative value.) Include all necessary data declarations and initializations.
Advertisement
Add Comment
Please, Sign In to add comment