Homework 1X Part 1

This is the first part of a three-part assignment. The ultimate purpose of this assignment is to write a children’s word substitution game. An evolving overview of the entire assignment can be found in the Overview of Homework 1X.

Due date

This assignment must be submitted as two files named WordLoop.h and WordLoop.c for Homework 1X Part 1 of the ECE 209.602 / CSCI 373.002 section on UNCA moodle by 11:00 PM on Wednesday, 1 December.

Getting starting

Start by downloading the following three files.

You should store these files in a NetBeans project. (If you want to use gcc from the command line, a Makefile is available.)

You should be able to compile and run your program with these three files. However, to do something useful, you’ll need to modify WordLoop.h and WordLoop.c.

The comments in these two files along with the Overview of Homework 1X and information from class lectures should tell you how to modify the two files to implement WordLoop.

A ZIP file

If you are willing to take a chance, you can download a ZIP file that contains a image of a NetBeans project for starting the project. These haven’t been tested, but if they work (or don’t work) for you send me email.

Approaches to a solution

Any implementation of WordLoop is required to work on an arbitrary number of words of an arbitrary size. This means you must use dynamic memory in your solution.

There are a couple of possible implementations of WordLoop discussed in class and in the textbook. These are a linked-list implementation and an array implementation.

I’ve implemented them both. To give you some idea of the task facing you, here is a table giving the number of lines of code I added to the files in my two implementations.

RoutineLinked listArray
WordLoop.h 6 6
helper routine to allocate data for a word
used in both CreateWL and AddWordWL
12 7
CreateWL 12 12
AddWordWL 8 21
NextWordWL 1 1
AdvanceWL 1 3
DestroyWL 10 6

Keeping on schedule

Parts 1, 2, and 3 of Homework 1X are due on consecutive days. If you wait until after Thanksgiving to start this assignment, you will not complete it on time.


This homework assignment will be allocated 75 points, distributed as follows.

10 File submitted with proper name
5 Compiles with no warning using -pedantic or -std=c99
10 Program is readable and maintainable
10 Appropriate structures for dynamic data
10 CreateWL
10 AddWordWL
5 NextWordWL
5 AdvanceWL
10 DestroyWL