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 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
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
Get step-by-step solutions from verified subject matter experts
