Computer Science I

MC140.01
Spring 2001
Assignment 9
due Wednesday 25 April 2001

The goal of this assignment is to practise using structures.

This assignment is worth 2% of your semester grade. For this assignment, you'll create a scheduling program for yourself to keep track of everything you have to do before the end of the semester.

1. (4 points) Define a data structure called stuff to store the following fields of information:
  • course name:
  • 20 characters
  • assignment title:
  • 20 characters
  • assignment description:
  • 100 characters
  • priority:
  • integer

    2. (2 points) Declare an array called to_do containing a maximum of 25 instances of stuff. This array must be local to the main() function.

    3. (4 points) Write a function that will ask the user to enter data for one instance of stuff and store the information entered by the user in an argument instance of stuff. The function header should look like this:
    void enterStuff( stuff *stf );

    4. (4 points) Write a function that will print all the instances of stuff in the to_do array. The function header should look like this:
    void printStuff( stuff stf[],int size );

    4. (4 points) Write a main program that lets the user enter up to 25 records in the to_do array, by calling the enterStuff() function. After each entry, the program should ask the user if s/he wants to enter more stuff. When the user is done entering stuff (or the maximum of 25 entries is reached), then the program should call printStuff() to print out the entire list in a neatly formatted way.

    5. (2 points) Make sure you do the following:

    5. Submit the assignment in the usual way (i.e., follow the submission instructions from assignment #1). Also, please bring a hardcopy to class, and please staple loose sheets together!