$29
Assignment 6
File IO
Program Design
Assignment reminders:
1. This is the last assignment and you should know how to debug your program
2. The assignment must be submitted by the due date
3. The extra day for re-submission is ONLY if you have a minor error in your code and you
fix it, and even then I will decide if I accept the re-submission or not.
4. Make sure your code compiles on Circe
5. Make sure your code compiles on Circe
6. Make sure your code compiles on Circe
7. Write and debug the assignment one function at a time.
You are to write a complete program that opens an input file Lists.in, reads the
instructions from the file and writes the output to a Lists.out file. The instructions
correspond to the functions to be completed in the Lists.c file. An initial list is given in
Lists.in. An example of a Lists.in file is:
10
11 22 33 4 58 6 72 8 49 120
Move 3 7
Delete 10 0
Insert 7 9
Insert 10 11
Merge 3 4
The first line of the Lists.in file contains a number which represents the number of
elements of the initial list.
The second line of the Lists.in file is the elements of the initial list.
The next lines (until the end of the file) are the set of instructions.
Your program should print the initial list in Lists.out and then print the list after each
instruction has been executed. An example of a Lists.out file for the above Lists.in file
would be:
11 22 33 4 58 6 72 8 49 120
11 22 33 58 6 72 8 4 49 120
11 22 33 58 6 72 8 4 49
11 22 33 58 6 72 8 9 4 49
11 22 33 58 6 72 8 9 4 49 11
11 22 33 64 72 8 9 4 49 11
EXTRA CREDIT (10 points):
- To receive the extra credit your program must create a Debug.out file and store
meaningful debugging messages in it such as when a function is being called, when a function
ends and any other important debugging messages. I will decide if the number of debugging
messages is sufficient.
Files:
You are provided with Lists.c , Lists.h , main.c and Makefile. Do not modify Lists.h . You are to
submit Lists.c and main.c
Grading:
Your code will be tested with 9 regular test case inputs (10 points each) and 2
special test case inputs (5 points each)
Submission:
Submission should be done only through Blackboard. Submit only Lists.c
and main.c
Compiling and testing:
To compile your file make sure all of the files are in the same directory. Type
“make --always-make” in the terminal in the directory of the files. If there
are no compilation errors a main executable will be created.
To test your program run “./main” from the terminal in the directory of the
files.