Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EV 2 . 0 will behave as described for EV 1 . 0 , except that rather than have separate data input and datamanipulation loops,

EV 2.0 will behave as described for EV 1.0, except that rather than have separate data input and datamanipulation loops, there will be a single user option loop that will allow the user to merge new data orpurge existing data at any time by selecting m for merge and p for purge alongside the options presentfor output, sort, find, efficiency, and quit. Also, there will be an additional data saving/display option r.(Menu: Enter (o)utput,(s)ort,(f)ind,(e)fficiency,(m)erge,(p)urge,(r)ecords,or (q)uit: ).The user will be prompted for a data file name when EV 2.0 is started (Enter data file name: ), sothat it has at least some data present before it enters the user option loop. As EV 2.0 reads that first datafile, it will ensure that the list is maintained in order based on RecordID values. If EV 2.0 has troubleaccessing the data file named by the user, it should provide the user with an appropriate error message(File is not available.), then ask for a new file name. Similarly, if the file is available, butno valid data are found in the file, EV 2.0 will give an error message indicating that no valid data wasfound (No valid records found.) and again prompt for a file name. Only when at least onevalid record is read will EV 2.0 proceed to the user option loop. As with EV 1.0, if the user hits enterrather than entering a file name, EV 2.0 will exit.If the user selects merge, EV 2.0 will prompt the user for the name of a file (Enter data filename: ). EV 2.0 will then attempt to read that file, following the same rules regarding invalid data andduplicate record within the same file as used in EV 1.0. All valid records with non-duplicate data fromthis new file will be merged into the existing database, keeping the records sorted in order by RecordIDvalues (created). If any of these new records have a RecordIDs equivalent to one already created in thefile for a record, the old data will be replaced by the new data. For merged data, you must also createemission and petroleum reduction columns in addition to RecordID.If the user selects purge, EV 2.0 will likewise prompt the user for the name of a data file at the terminalprompt (Enter data file name: ). EV 2.0 will then attempt to read that file, following the samerules regarding invalid data and duplicate records within the same file as used in EV 1.0. However, inthis case, it will purge (delete) from the database all valid entries with RecordIDs that match those ofthe data read from the file. If there are records in the purge file that do not appear in the existingdatabase, these will simply cause no change to the data.If EV 2.0 has trouble accessing the merge or purge file named by the user, it should an appropriate errormessage (File is not available.) and repeat the prompt for the file name. If the user hitsenter (and nothing else) at the prompt for a file name, EV 2.0 will return to the menu for the useroption loop without having merged or purged any data, leaving all data structures unchanged.At the end of each successful merge and purge operation for the linked list, EV 2.0 will replacethe sorted array of data with a new array of record data sorted by RecordID values by discardingthe old record array and copying the data from the EVRecord linked list to a new EVRecord dataarray. Note that reading data files for both merging and purging will potentially increase the number ofdata lines read and the number of valid records reads.If the user selects r, EV 2.0 will prompt for an output filename following the same process as for theoutput option (o), then will go through the linked list of data, printing each record in the order it isfound in the linked list (which should be in order by RecordID values) using the same format andfollowed by the same summary line as for output (o)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions