you will need to write a single python program that given an input file produces a report that reports information about the file.
Your program should have the following methods/functions::
(20%) main()function that runs the overall program.
First, you have to ask the user for input usinggetInput()function (see below)
Then, repeatedly ask user for next command usinggetCommand()function (see below)
Depending on the command received, either call the function that represents the command
(or stop looping if quit was received)
Note: somewhere in the program, there must be a call tomain()
(20%) getInput()function that asks the user for an input file.
The function should repeatedly ask for a file until given a filename
The function should return a valid file name (test by seeing if the file opens)
(10%) getCommand()function that returns a command which should be one of the following: a. list
b. search c. addd. quit
(10%) list() functionshould output a list of all records stored in the file
(30%) search()function should allow the user to search for a specific item or a list of items and
display the records stored in the file that match the query
The function should take three parameters: name of field to search, value to search for, type
of search
Type of search can be either:equal, notequal, greaterthan, lessthan
The function should take the three things and produce a list of items that match the given
criteria.
(10%) add()function should allow the user to add a record to the file
a. The function should ask for each element of the record from the user
Record:Integer EID
String name String position Integer yos Double salary
Record Format (each record is on a line by itself): EID:name:position:yos:salary
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here