Must produce the output:
square 0 0 24
square 2 5 4
triangle 10 10
circle 5 16
point 15 3 '?'
************************
* *
* *
* ? *
* *
* **** *
* * * *
* * * *
* **** *
* *
* + *
* + + *
* +++++ *
* *
* *
* *
* oo *
* o o *
* o o *
* oo *
* *
* *
* *
************************
The x,y will determine where in the Grid the rectangle is drawn. For example, if x = 5, y = 6, the * in the top left corner of the square would be drawn at grid location 5,6. The square (and all the other shapes) will draw into the grid by calling Grid::set(). The * in upper left corner of this square would be drawn by calling grid.set(5,6,'*'). The next * would be drawn by grid.set(6,6,'*').****
* *
* *
****
int main()
{
Grid my_grid;
Square my_square(5,7,10); // is located at x = 5, y = 7 and is 10x10 characters in size
my_square.draw(my_grid);
my_grid.print();
}
+
+ +
+++++
# +
+ +
+++++
oo
o o
o o
oo
0,0
0,1
1,0
1,1
I will deduct 10 percent if your program does not compile using my Makefile on the lab machines. Thus you must make sure to use the filenames listed below (do not capitalize your filenames), and if you are working on windows, you should compile and test your program on one of the department's suns before turning it in.
We will grade your program using another program, so if your program does not work exactly as specified below you will lose points.
The first lines of all your files (.h and .cpp) must contain:
/****
last name, first name
ecst_username@ecst.csuchico.edu
112 Program 6: Object-oriented shapes
****/
You must turn in the following files:
copy the above files into the directory:
grid.h
grid.cpp
shape.h
shape.cpp
triangle.h
triangle.cpp
square.h
square.cpp
circle.h
circle.cpp
point.h
point.cpp
where USERNAME is your ecst username./user/projects/csci112/p6/USERNAME
Note: You will not be able to access this directory once the deadline has passed.
If you do not finish by the deadline (see top for the deadline), you may turn your assignment in up to 24 hours late. You will lose 15% for turning your assignment in 1-24 hours late.
If you turn your assignment in late, copy your assignment into the following directory:
Assignments will not be accepted if more than 24 hours late./user/projects/csci112/p6_late/USERNAME