EECS 110: INTRODUCTION TO PROGRAMMING

Programming Assignment #4

If you pair-program, put both names in comments at the start of all your code files. Pair programming means all work done together!

This assignment has two problems, a console-based C program, and adding new features to your graphical application.

Problem #1: Grade Reports

Do Project 48 in Chapter 8 of the textbook . Define main() to read two different data files, and print a report for each. The data files are grades-1.txt and grades-2.txt.

Your code should

Create a folder PA4. Call your main C file main.c. Put the two grade files in PA4. When you run your program, copy your output and put it in a text file with the name output.txt. Put this file in PA4. If you don't know how to copy console output to a file in Windows, see these instructions.

Problem #2: Your Interactive Graphics Project, part III

Add animation to your picture, using global arrays to hold data about all the objects on the screen.

Call the main C file main.c and put it in the folder GAME.

You'll need an array for each piece of information that differs from object to object. Each array will be N long where N is the maximum number of objects to be described. You'll probably need arrays for

Tip: for colors, use an array of hexadecimal color integers.

Change your program so that, when it first starts, it initializes the object data arrays. This can be done in your main() function, before calling InitGraphics(). Then, in myDisplay(), you will call functions to update the data and draw the objects using that data. Updating the data means changing each object's location or size or color or whatever makes sense for your animation.

Be creative! Changing location to move objects is fine, but explore how changing size can make objects look like they're coming closer or moving away, how changing colors can turn day into night, etc.

Submit

Follow the standard 110 submission rules. Use the folders and file names given above.

If you have written code in any other source files, include those too. Do not include compiled output, such as .o files or .exe files

Do include the grade files and your output.txt file.

Email with the Subject line: EECS 110: PA4.


Valid HTML 4.01 Strict