This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: The launch angle is set by the user. Both the direction angle and the launch angle can only be set to +/- 2 degrees (human error!) Page 2 of 2 a) Use the diagrams to show the variables and formulas that you will be using so we can follow your code. b) Write a function that receives a launch angle in degrees and returns the range for the dart. You may hard-code any constants. c) Professor Bedi has written a function that returns a random number. Its use is shown below. double x = random ( -1.5, 3.0); // x will be between -1.5 and 3. Write a main function that: prompts the user for his/her name for each of 10 darts o prompts for, and reads a launch angle o adjusts for the random error in both the direction and launch angles o calulates the x and y positions of the landing point ( You must use your function! ) o updates the score prints out the name and the total score....
View Full Document
This note was uploaded on 04/01/2012 for the course GENE 121 taught by Professor Smucker during the Winter '11 term at Waterloo.
- Winter '11