Click to reopen instructions.

Your mission is to draw a flag of the United States. The starting point for your code will be in the drawFlag method which will be called for you with a Graphics object and two ints representing the width and height of the drawing area. You should write your code there though you may want to break it into helper methods which you call from drawFlag.

The only methods you need to use from Graphics are setColor and fillRect. You can see an example of each in the drawBackground method in the starter code. You will also almost certainly need to use the drawStar method provided in the starter code.

Your flag must follow the proportions set out in the US code as summarized in this US Flag specification. In addition to being properly proportioned, your flag should be 90% of the size of the largest properly-proportioned flag that could fit in the drawing area and should be centered horizontally and vertically.

If you finish early: If you get your flag working before the end of the period, as an extra challenge, modify the getStar method to take an argument of the number of points and draw a start with that many points rather than always drawing a five-pointed star.

Put definitions here.

Revisions:

Flag

Compilation errors