Question: Write a 10-15 line algorithm/pseudo-code that asks the user to input 2 numbers (called angle and speed). The algorithm then simulates the firing of

Write a 10-15 line algorithm/pseudo-code that asks the user to input 2 numbers (called angle and speed). The

Write a 10-15 line algorithm/pseudo-code that asks the user to input 2 numbers (called angle and speed). The algorithm then simulates the firing of an arrow at that angle relative to the ground, at that launch speed (as in Figure 1). The algorithm then determines how far up the arrow goes, how far away the arrow lands, and how long it flies before landing. Then these 3 values are output to the screen. Include a check on the input data, and output an error message if the user provides a bad speed or angle. arrow angle Figure 1 ground

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

function main angle speed getInput if isValidangle speed flightData simulateFlightangle speed displayResultsflightData else displayError function getInput angle getUserInputEnter angle in degrees 090 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!