Lab 7: File IO: Project Goals
Lab 7: File IO: Project Goals
Project Goals
Important Notes:
1. Formatting: Make sure that you follow the precise recommendations for the
output content and formatting: be sure to include command line arguments when you
start your program. Your assignment will be auto-graded and any change in formatting
will result in a loss in the grade.
2. Comments: Header comments are required on all files and recommended for the
rest of the program. Points will be deducted if no header comments are included.
Problem
Write a program which opens a input.txt file for reading and checks for a successful
connection to the file stream. If it cannot open the file, an error message should be displayed:
Cannot open input file. The input file is filled with an unknown number of integers,
each separated by a comma and a space. If the program can open the file, these integers should
be read in one by one and output to the screen, each written on a different line (just the integers -
disregard the punctuation and spacing).
In addition to the main functions, your program should have 1 more function:
displayValues()
Input Parameters: FILE pointer
Returned Output: none
Functionality: This function should accept a file pointer which has already been connected to a
file stream. It should read each of the numbers from the file, along with the comma and space
which separate the values. Each of the integer values should be displayed to the screen on a
separate line.
Run your program again, testing with mixed cases to see the different values.
Notes:
● You can use the feof() function to know when you’ve reached the end of the file!!!
Grading Rubric
Correctly-named file 5%
Header comment 5%
Submission details
To submit your project, you will have to use the submission script. You do this by either:
1. Working on an ECC machine
2. Working on the provided VirtualBox installation
Academic Honesty
Academic dishonesty is against university as well as the system community standards. Academic
dishonesty includes, but is not limited to, the following:
Plagiarism: defined as submitting the language, ideas, thoughts or work of another as one's own;
or assisting in the act of plagiarism by allowing one's work to be used in this fashion.
Cheating, plagiarism or otherwise obtaining grades under false pretenses constitute academic
dishonesty according to the code of this university. Academic dishonesty will not be tolerated
and
penalties can include cancelling a student’s enrolment without a grade, giving an F for the
course, or for the assignment. For more details, see the University of Nevada, Reno General
Catalog.