Trajectory - misses the target, the user should again be...

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

View Full Document Right Arrow Icon
CSC 113 Midterm Project: Trajectory Assigned: October 15, 2010 Due: October 29, 2010 Objective: To test your knowledge of loops, figures, plotting, and graphics Assignment: Write a game which prompts the user for and angle and an impulse to attempt to hit a randomly placed target. The user should get three tries to hit the target. Inputs: none Outputs: none When the user launches the program, a figure should open showing the location of the randomly placed target. The user will be prompted for an angle between zero and ninety degrees as well as an impulse to apply. Your program MUST perform error-checking on user input . For example, if the user enters a negative number, the program should prompt the user to enter a positive number. Upon entering the angle and impulse, the game should plot the trajectory of the shot. If the shot hits the target, a message should be displayed and the program will prompt the user for a new game. If the shot
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: misses the target, the user should again be prompted for an angle and an impulse. The second and third shots should be plotted in a different color. If the user fails to hit the target in three tries, the program should display a message and prompt the user for a new game. Submission: Projects will be graded in class on Friday, October 29. You must be present to receive a grade, and you should be prepared to explain how sections of your code work. Late projects will not be accepted . Hints: To generate random numbers, use the rand or randi functions. Research graphics handles, as well as the special handles gcf and gca . Help: Steven Hair 01hair@cardinalmail.cua.edu Nathan Doane 96doane@cardinalmail.cua.edu Office Hours: Mondays 10:00-11:00am Thursdays 3:00-5:00pm Website: http://faculty.cua.edu/regalia/csc113...
View Full Document

Ask a homework question - tutors are online