Pascal Programming Assignment #2
Write a Pascal
program which will utilize the following Pascal capabilities:
- Reading from and writing to files
- Using records to store data
- Dynamically allocating the records
(using pointers)
- Inserting data into a linked list,
keeping the list in descending order at all times by the grade
field of the record.
Your program
should
- Describe itself to the user
- Obtain the name of the file in which
the data is stored from the user (i.e. the input file name)
- Obtain the name of the file the user
would like the file output to be stored in from the user.
- Print the data in each record as soon
as the record has been created (to the screen)
- Print the data in each of the records
in the linked list after each record has been inserted to the screen and
to the output file. Have each record on a separate line. Have a blank line between lists.
- There will be data for (5) records in
the input file.
- As the program ends, it should print
to the screen a message telling the names of the input file and output
file used and say that the program is done.
The records in the
input file are student data records consisting of the following
information. Each data item will be on a
separate line.
- A student name
- A student age
- A student grade point average.
Hints:
- Be sure you are reading from the input
file not the output file
- Be sure to use single quotes around
your prompts and labels (not double quotes)
- Be sure to use a period between your
record variable and its field (not a comma)
- Remember that you are being asked to
write some things to the screen and some things to the output file.
- Note we are not using arrays in this
program.
- Write a bit of code to do one task at
a time. When it works, make it into
a procedure and think about what the parameters should be.
- The shortest way to have output go to
two destinations (file and screen) is to write a procedure to produce the
output and pass the destination as a parameter.
- File parameters should be var parameters.
- Use textfile
as your file type.
- Read this entire
list of requirements and hints carefully multiple times.
Due date: Because of the lateness in my posting of this
assignment, it will not be due on its original due date of Thursday, October 7th,
but will be due on Tuesday, October 12th.
Deliverables:
- Folder
- Disk
- Source in root
- Executable in root
- Your sample input file in root
- Output file your program produced in
root
- Printouts
- of source
- of sample input file
- of output file produced by your program