CS 010 - Introduction to Computer Science I
Assignment 3:

DUE: Fri, April 22th before 2:00pm


Collaboration Policy

Limited collaboration is OK. You may do the following while writing a programming assignment: discuss general solution ideas with your study group members or have members observe a run of your program, and offer their ideas on its behavior. You should *never* look at someone else's code for the assignment to figure out how to do your own program. It is very hard to write your own unique solution once you have seen someone else's. If you need someone to look at your code to give advice, you should see your TA or instructor. Of course, copying code from ANY source (any book, current or past student, past solutions, or the web) is STRICTLY FORBIDDEN.


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 using electronic turnin as in lab1, from a lab computer on campus, TURNING IN FROM HOME WILL NOT WORK!

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

Programs that do not compile will receive a 50 point penalty.

Programs that do not have the readme file turned in with the main.cpp file will not be graded.

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

// Course: CS 10
//
// Lecture Section: ... 001 or 002
// Lab Section: ... 021, 022, etc)
//
// Assignment #: ... assignment 2, 3, etc.
//
// Last Name: Enter your LAST (family) name here (eg, Doe)
// First Name: Enter your FIRST (given) name here (eg, John)
//
// ID Number: Enter your ID number here (eg, 860-00-0000)
// lab login id: Enter your cs10 login here (eg, jdoe)
//
// Email address: Enter your UCR email address here (eg, jdoe@cs.ucr.edu)
//
// =======================================================================



Problem Definition:

    For this assignment you will write a program that draws a picture, and then alters it based on user input.  The picture must have 3 different elements;  a space ship, a landscape, and a big C on the landscape.  You can draw the ship and landscape any way you like, so be creative!  
    Once your ship and landscape have been drawn, you will ask the user for a new x, and y position to draw the ship at.  After the user enters these values, you should clear and redraw the screen with the ship at the new coordinate.  The initial position of the ship is up to you, as long as it is visiable in the first drawing.  You do not need to check if the numbers entered by the user are valid.  The landscape and big C should be unaltered in the new drawing, and the ship should not be "deformed" when redrawn.
    Below is a link to an executable version of the program as described above.

Hints:
- Use the move(int, int) method from the Point class to move the drawing of your ship
- Use the get_int(string) function to get the new x, and y value for the ship (once for x, once for y)

Example program download
main

The above link is attached to an executable version of the program.  Below are instructions to downlaod the program.  Note that this will only work on the lab computers, or computers running linux, so it probably won't work if you try to download it from home on a Windows machine.

1)  Right click the blue link above, and then select "Save Link Target As..." by left clicking.

2)  A message box will open asking you where you want to save the file.  Choose from the list of folders by double clicking on the folder that you want to save the game in.  If you want to save it in your home directory, you can just left click "save".

3)  Now cd into the directory that you saved the game.  On the command line type the following command:
chmod u+x main

You will only need to do this once (the first time).  You can close the other message box that opens (the one that says Download Manager).

4)  From now on, to run the program, you can just type "main" from the command line.


Rubric: (100 pts total)

15 pt(s): Draws a ship with at least 4 lines
10 pt(s): Draws a landscape with at least 7 lines
10 pt(s): Gets input for x and y from graphics window, not from terminal
  5 pt(s): Landscape and C are unaltered in new drawing
10 pt(s): Ship is not defornmed when redrawn
20 pt(s): Redraws ship at correct position in new drawing
  5 pt(s): Prints a C on the landscape with Message function
  5 pt(s): clears screen between original and new drawin
g
20 pt(s): Style
    - comments
    - line wraps
    - spacing
    - Indentation
    - Good constant/variable names
    - No magic numbers

Fill out the following form, and turn it in with your program:
readme.txt

Note that you will lose points for style on this assignment!
For coding style requirements see the following link:
http://www.cs.ucr.edu/cs10/cs10_05win/requirements/coding_std.html