CS 010 - Introduction to Computer Science I
Assignment 6:

DUE: Thursday, 8/19 before 11:00pm


Collaboration Policy

Collaboration is strongly ENCOURAGED. You will be working in teams, but programs must represent YOUR OWN original work. Teams should work on the algorithm together and help debug/test each others code. However, copying code from ANY source (any book, current or past students, past solutions, the web, etc.) is STRICTLY FORBIDDEN. Code between teamates will be similar, but you are not allowed to just copy a teamate's solution.


Code that is turned in, must be contained in a .cpp file named main.cpp. Files of any other format will not be graded (e.g. main.doc, main.txt, etc…).

You must turn your work in from a lab computer on campus.

Turn in online to as6 folder. If you turn your assignment in to the wrong folder, your assignment may not be graded. If it is graded, you will lose 2 pts (out of 10).

Remember to include the following header information at the top of your program;

// last name, first name
// last 4 digits of SID
// UCR email address
// user name (log in name)


Problem Definition:

    For this assignment you will add code to programing assignment 5.  You will add a function that will draw your ship instead of a circle, and allow the user to move the ship both left, and right.  You do not need to worry about collision with the window's edge.  Unlike the previous assignment, you will now have to modify the code in ccc_win_main.  You will also have to modify your set_acceleration function to take two reference parameters (which will be the x, and y acceleration), and return void.    
    Now the user will be asked to set the main, right, and left thruster.  Movement to the left and right will be according to the same equations used in assignment 5.  As in the last assignment they can choose between Hi, Low, or None.  
The acceleration in the x direction should be reset to zero at the beginning of the acceleration function, and then set according to input from the user.  Setting the right or left thruster to High should be equivalent to an acceleration of + or - 1.  Setting the right, or left thruster to Low should be equivalent to an acceleration of + or - 0.5. You will use the same functions that you wrote for assignment 5 to set the x position and velocity.

Example Program Download
main


Rubric: (10 pts total)

1 pt: Has only one set velocity function
1 pt: Has only one set position function
1 pt: Set acceleration function is correctly passed two variables 1 pt: Acceleration function correctly sets accelerations 2 pt: Ship moves correctly according to position functions 2 pt: Draws ship of using function, and ship is big enough to see
2 pts: Style (0.5 each)
 - Good variable names
 - Proper indentation
 - Good comments
 - No line wraps