Information and Pictures

This file contains detailed information about each flag required for project #2 and pictures of each flag in two different sizes. Realize that these are just examples of two randomly chosen sizes. From the description, you need to be able to extend this to any other valid size for that flag.

1. Indonesia

The Indonesian flag is two equally spaced horizontal stripes where the top is red and the bottom stripe is white.
The height specified by the user must be a multiple of two. The multiple of two allows the stripes to be of the same size. If a "non-multiple of 2" value is given, the error flag must be drawn instead.


Size 6


Size 18

2. Lithuania

The Lithuanian flag is three equally spaced horizontal stripes where top is yellow, the middle green and the bottom red.
The height specified by the user must be a multiple of three. The multiple of three allows the three stripes to be of the same size. If a "non-multiple of 3" value is given, the error flag must be drawn instead.


Size 6


Size 12

3. Rwanda

The flag for Rwanda is three horizontal stripes (we are going to skip the sun). The horizontal stripes are not equal. The top, the blue stripe, is the top half of the flag, and the bottom half is two equally sized horizontal stripes which are yellow and green.
The height specified by the user must be a multiple of four. If a value is given that is not a multiple of four, the error flag must be drawn instead.


Size 4


Size 12

4. Malta

The flag for Malta has two equally spaced vertical stripes (we are going to ignore the top left corner). The left half is white and the right half is red. This flag can be drawn in any size because the width of a flag is always even.


Size 5


Size 10

5. Afghanistan

The flag for Afghanistan has three equally spaced horizontal stripes (black, red and then green). We will skip the crest in the middle.
The height specified by the user for this flag must be a multiple of three. If a non-multiple of three is given, the error flag must be drawn instead. (Note: the size typed by the user is actually the height, but because the width is 2 times the height, the width would also then be a multiple of three.)


Size 9


Size 24

6. Eritrea

The flag for Eritrea has three triangles (again skipping the crest). The red triangle covers the whole left side and goes to a single point on the right side. The single point will be a single pixel high when the height of the flag is odd but will be two high when the height of the flag is even. The triangle above the red is green and below is blue. The red triangle must cover the whole left side of the flag and then get one unit smaller on each side after each set of four columns until it comes to a point in the vertical center of the flag. (Note in the pictures shown how the odd and even have different methods of ending in a point - so the last set might not have a whole set of four.) The height specified by the user for this flag can be of any size.


Size 5


Size 20

7. Macedonia

The flag for Macedonia has a red background with orange sun that has a center part connected to vertical, horizontal and diagonal lines in each direction. The center we are going to make rectangle for ease in drawing and it will be a 4x8 rectangle regardless of the size of the flag. The vertical line will be exactly two pixels wide, and the horizontal line will be exactly two pixels high. The diagonals must be two wide with no overlap from segment to segment.
The height specified by the user for this flag must be even and at least 8. If an odd value is given or a value less than 8 is given, the error flag must be drawn instead.


Size 10


Size 16

8. The Bahamas

The flag for The Bahamas has three equally spaced horizontal lines (they might not be exactly equal in this picture, but we will take artistic license on that too). It also has a black triangle that covers the left side completely and gets one smaller on each side until it reaches a point. The color in the center stripe is "gold" but we will use yellow to represent gold.
The height specified by the user for this flag must be an odd multiple of three. It is a multiple of three so that the stripes can be equally spaced. It must be odd so that the triangle comes to a single character at the point. If value is given that is not a multiple of three or it is even, the error flag must be drawn instead.


Size 9


Size 15

9. Zimbabwe

The flag for Zimbabwe has 7 equally spaced horizontal stripes and a white triangle. The size of the flag must be a multiple of 7. (We are ignoring the bird and the black outline of the triangle.) The triangle must completely cover the left side, and must come to a single character point when odd or a 2 character high point when even.
The height specified by the user for this flag a multiple of 7. If a non multiple of 7 value is given, the error flag must be drawn instead.


Size 7


Size 28

Invalid / Error Flag

The error flag should be displayed as a white flag with a single colored square in each of the four corners. If the height given by the user between 4 and 30 (inclusive), but the dimensions are not allowed by that specific flag as defined above, the error flag should be displayed in the dimensions given by the user. If the size given is less than 4, the exampleDriver creates a flag that is 4 high for you to display the error flag in. If the size given is greater than 30, the exampleDriver creates a flag that is 4 high for you to display the error flag in. If the flag is between 4 and 30 (inclusive), but the countryCode is not one provided by the menu, the Error Flag of the specified size should be created. Notice the top left corner is red, the top right corner is yellow, the bottom left corner is blue and the bottom right corner is green. The remainder of the error flag is white.


Size Requested: -15


Size Requested: 15 but requested on a flag whose size needed to be even