Assignment 3 for CSCI 201

Description:

In this assignment, you are asked to write two programs. First you will write a program that uses iterative and conditional statements to create a geometric figure. The figure will be a mosaic of rectangles shapes (or another shape if you choose) defined in the the EzWindows library. The second program will get you in the holiday spirit by answering the question, "On the 'x' day of Christmas, what did my true love sent to me?" The details are below.

Program 1:

(worth 15 points)

The program mosaic.cpp produces a 2-dimensional rectangle composed of blue and red squares. Your assignment is to modify Mosaic.cpp to produce some 2-dimensional geometric shape other than a square or a rectangle. For example, you could produce a triangle (right-side up or upside down), or a diamond. Other options are also acceptable. In addition, if you want to, you may change the size and color of the squares that are used to produce the larger 2-dimensional shape.

Program 2:

(worth 10 points)

The file christmas.cpp contains part of a program that will output the words of the song, "The Twelve Days of Christmas." Your assignment is the complete the program so that it will generate the following output:


On the first day of Christmas,
My true love sent to me:
A partridge in a pear tree.


On the second day of Christmas,
My true love sent to me:
	Two turtle doves, and
A partridge in a pear tree.


On the third day of Christmas,
My true love sent to me:
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the fourth day of Christmas,
My true love sent to me:
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the fifth day of Christmas,
My true love sent to me:
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the sixth day of Christmas,
My true love sent to me:
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the seventh day of Christmas,
My true love sent to me:
	Seven swans a-swimming,
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the eighth day of Christmas,
My true love sent to me:
	Eight maids a-milking,
	Seven swans a-swimming,
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the nineth day of Christmas,
My true love sent to me:
	Nine ladies dancing,
	Eight maids a-milking,
	Seven swans a-swimming,
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the tenth day of Christmas,
My true love sent to me:
	Ten lords a-leaping,
	Nine ladies dancing,
	Eight maids a-milking,
	Seven swans a-swimming,
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the eleventh day of Christmas,
My true love sent to me:
	Eleven pipers piping,
	Ten lords a-leaping,
	Nine ladies dancing,
	Eight maids a-milking,
	Seven swans a-swimming,
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.


On the twelfth day of Christmas,
My true love sent to me:
	Twelve drummers drumming,
	Eleven pipers piping,
	Ten lords a-leaping,
	Nine ladies dancing,
	Eight maids a-milking,
	Seven swans a-swimming,
	Six geese a-laying,
	Five golden rings,
	Four calling birds,
	Three French hens,
	Two turtle doves, and
A partridge in a pear tree.

What to turn in:

You should turn in a floppy disk containing both programs at the start of class two weeks from the assignment date. The disk should be labeled (on the outside) with your name and section number. The disk should contain either a cleaned workspace for each part of this assignment (each program should have its own workspace, i.e., project folder) or you can turn in just the C++ source code for each of the programs described above. Either format will be accepted.