Problem 3

# Problem 3 - cannonball is gravity with an acceleration of a...

This preview shows page 1. Sign up to view the full content.

ECOR1606 Problem Solving and Computers Page 1 of 1 Department of Systems and Computer Engineering, Carleton University Summer 2003 Assignment 1 – Cannonballs A cannon is used to fire a cannonball as shown in Figure 1. The mouth of the cannon is at a height y 0 and is considered being at a horizontal distance of zero (i.e x 0 = 0). The initial velocity of the cannonball is v 0 , with the cannonball traveling at an angle of θ from the horizontal axis. Assuming that the air resistance negligible, the only force acting upon the
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cannonball is gravity with an acceleration of a y = 9.8 m/s. θ y x y Figure 1 Write a C++ program, which obtains user inputs for y (m) v (m/s) and θ (degrees) and outputs both the time (s) and horizontal distance (m) the cannonball travels before hitting the ground (y = 0 m). Note that trigonometric functions in C++ are computed in radians not degrees! Do not forget that you may lose marks for poor style. Read the notice on the Assignment page on the website!...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online