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 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 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 2 of 22511-1520A08R01
Program 2 display.c (Revise Assignment 7 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:
1. Natural order
2. Account Balance Descending
3. Exit
Place the menu in a loop so the user can display in different orders without having to restart the
program.Program 2 display.c (Revise Assignment 7 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:
1. Natural order
2. Account Balance Descending
3. Exit
Place the menu in a loop so the user can display in different orders without having to restart the
program.
Please Hand In:
1. Zip your source files and datafile; upload the zipped file to the Assign08 Dropbox on D2L.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!