Question: Program 1 index.c Write a program that reads the accounts.dat created in Assignment 7 and creates an index file to enable display.c to display the
Program index.c
Write a program that reads the accounts.dat created in Assignment and creates an index file to
enable display.c to display the data in sorted order. Account Balance Descending
Name your index file accounts.idx
The data filename and index filename will be passed to the program via command line arguments.
For simplicity, have the files reside in the programs current directory.
Example:
exename datafilename indexfilename
When the program starts, validate the arguments as follows:
a Check for the proper number of arguments. If incorrect, display a useful error message to the
user and exit the program.
b Ensure that the datafile exists. If the file does not exist, display a useful error message to the
user and exit the program.
Page of AR
Program display.c Revise Assignment version
Modify display.c to use the index file created in index.c
The data filename and index filename will be passed to the program via command line arguments.
For simplicity, have the files reside in the programs current directory.
Example:
exename datafilename indexfilename
When the program starts, validate the arguments as follows:
a Check for the proper number of arguments. If incorrect, display a useful error message to the
user and exit the program.
b Ensure that the datafile exists. If the file does not exist, display a useful error message to the
user and exit the program.
c Ensure that the indexfile exists. If the file does not exist, display a useful error message to the
user and exit the program.
Create a menu which allows the use to display the data in:
Natural order
Account Balance Descending
Exit
Place the menu in a loop so the user can display in different orders without having to restart the
program.Program display.c Revise Assignment version
Modify display.c to use the index file created in index.c
The data filename and index filename will be passed to the program via command line arguments.
For simplicity, have the files reside in the programs current directory.
Example:
exename datafilename indexfilename
When the program starts, validate the arguments as follows:
a Check for the proper number of arguments. If incorrect, display a useful error message to the
user and exit the program.
b Ensure that the datafile exists. If the file does not exist, display a useful error message to the
user and exit the program.
c Ensure that the indexfile exists. If the file does not exist, display a useful error message to the
user and exit the program.
Create a menu which allows the use to display the data in:
Natural order
Account Balance Descending
Exit
Place the menu in a loop so the user can display in different orders without having to restart the
program.
Please Hand In:
Zip your source files and datafile; upload the zipped file to the Assign Dropbox on DL
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
