Standards-10
Input and Output


Major errors

Read from the source required in the assignment. [3%]

This means your program reads input from the wrong place. That forces me to modify how my tester uses your program.

Write to the destination required in the assignment. [3%]

This means your program writes output to the wrong place. That forces me to modify how my tester uses your program.

The result of getc is an integer [8 points each, 2% max]

It is important not to store the result of getc or getchar into a variable of type char, because they can return EOF (− 1).

Follow the assignment concerning output format. [4-30 points, 5% max]

Make sure to follow the assignment regarding what is to be printed, and make the output readable.

Follow the assignment concerning input format. [4-20 points, 5% max]

Make sure to follow the assignment regarding what is to be printed.


Minor errors

End the last line of output with a newline character. [3 points]

Your program should write an end-of-line at the end of what it writes.

Check if opens succeed. [10 points each, 2% max]

If a file cannot be opened, the program must report that, and it must give the name of the file.

The program must not try to read anything from a file that was not successfully opened.


Close an open file when you are done with it. [10 points each, 1% max]

Be sure to do
  fclose(f);
when you are done reading from or writing to file f.