CS
010 - Introduction to Computer Science I
Assignment 4:
DUE: Thursday, 8/12 before 11:00pm
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 as4 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)
From this point on, any programs turned in that do not compile will receive an automatic zero, no exceptions.
1 pts: Allows user to move the ship around as long as it's inside the window
1 pts: Moves the correct direction based on user's input
3 pts: Draws a visable explosion at the point where the ship makes contact with the window's edge
1 pts: Correct function header for ship function
1 pts: Correct function header for explosion function
1 pts: Correct function header for ground function
2 pts: Style (0.5 each)
- Good variable names
- Proper indentation
- Good comments
- No line wraps
Bonus +1 point
Create a fourth function to handle collision detection with the
ground. When called, this function will return true if the ship makes contact with
either the landscape, or the window's edge, otherwise it should return false. Then, from your main
function, you should use the value returned by collision() to decide if
you should draw a ship, or an explosion. You should pass this function
a Point indicating the current position of the ship.