600.120 Intermediate Programming
Summer 2013 -- Assignment 6
Due by 9am on Friday, 6/21

Color Class [30 points]

Define a Color class which can be used to manipulate RGB colors in integer, rgb and hex forms. Your class must support the test program ColorTest.cpp exactly as given. Create your solution in two files: Color.h and Color.cpp. Include a rule to make a "colorTest" executable in your makefile.

Board Template Class [40 points]

Create a templated 2 dimensional Board class that could be used for a variety of applications including many games such as Checkers, Sudoku, Scrabble to name a few. The template part is the data type of each cell on the Board. We will assume that the stream input and output operators (<< and >>) are defined for any cell type that might be used with a board. We will also number the rows and columns starting with 0 in the top left corner of the board so as to have a consistent way of referring to each cell. In addition to its value, each cell has a background color and a foreground color, which can be used when converting the board into an html format for display.

You must have the following functions in your class:

You must use dynamic memory allocation to create your board, and must not have any memory leaks. Your class must support our test program BoardTest.cpp.

Makefile [5 points]

Write a makefile for all parts of the assignment with rules for colorTest and boardTest, and an all which creates both.

Submission & Grading

Only submit printouts of the files that you wrote, not our test files. Make sure everything is included in your submitted zip file.

Color Class30
Board Class40
Makefile5

Memory leaks/errors: -5 points, compiler warnings: -5 points


General assignment requirements, style and submission details:

Sunday, 14-Dec-2025 00:36:55 EST