Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

you will build a menu-based application for tracking student information. The specifications of the project are as follows: 1-It is a menu-based program with a

you will build a menu-based application for tracking student information. The specifications of the project are as follows:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1-It is a menu-based program with a main screen offering the user options to view records, add new records, search for records, delete records, and quit the program. Use a case statement to detemine what choice the user made, and perform the appropriate action. The only way to exit the application is by pressing 5" to quit the program. All other options should return to the main menu. Your program should handle the case in which the user doesn't enter anything, or the user enters an invalid option. 2-The student records are stored in a text file called student data. The file contains information about a student's ID, last name, first name, program name, and total credits. Each record is stored on one line and has the above five fields separated by the colon ;" character. The initial data file contains the following records: 1001:Jones Alice:Accounting 105 1320:Moore: Sarah: Mechanical Engineering: 80 2100:01son: Timothy:Computer Systems :66 1520 :Mitchell:Barbara: Electrical Engineering: 34 1800 Smith: Paul:Mathematics: 87 2010 :Whitman: Henry: Business Management:114 1480 :Richard: Johnson: Computer Systems: 90 1234 :Willims: David:Economics: 78 3-The View Records option should display a sub-menu, as shown in Figure 3, to let user choose how the records are sorted before they are displayed. The records can be sorted by last name or program name in alphabetic order, or sorted by credits in ascending order, or sorted by ID in ascending order by default. The records should be displayed in a neat fixed-length form as shown. in Figure 4The total number of records should also be displayed. The program returns to the main menu after records are displayed and the "Enter" key is pressed. 4-The Add New Records option should allow the user to enter the student ID, last name, first name, program name, and total credits. This informatonl be appended to the end of the file studentdata, all on one ine, separated by the coloncharacter. The last name cannot be blank for the new record to be written into the data file. If a student ID has already existed in the data file, display an error message and let the user reenter the data (see Figure 5). The program should allow the user to add more records until a 'q' for quit is entered. The user enters a q'. Modifying the previous field when the user types in-' or exiting if the user types in q is optional program retums to the main menu after the 5-The Search for Records option should prompt the user for a string pattern to search for in the data file and display all the records that contain that pattern (see Figure 8). 6-The Delete Records option should prompt the user for a pattern, display all the records that contain that pattern, ask the user to confirm yes or no to delete these records (see Figure 9, 10), and perfom the appropriate actions 7- The source code of the above four options (view, add, search, and delete) should be placed in four separate script files 8-The Quit option wil evit the upplication 9-Make a shell script called functions that defines the following three functions: sort_ID to sort the records in the ascending order of student ID, sort_lname to sort the records in the alphabetic order of student last name sort_program to sort the records in the alphabetic order of program name sort_credits to sort the records in the ascending order of total credits Use function(s) in the View Records module to sort the records according to user's choice 10-The program should have necessary comments including, but not limited to, the script name, date information, and the purpose of the script. Figure 3: View Records Menu Student Program Information Sort by: L- Last Name PProgram C Credit Any ID Enter your choice: Figure 4: View Records (The data are sorted on Credits) Student Program Information Student ID Last Name First Name Progranm Credits 520 2100 1234 1320 1800 480 001 2010 Mitchel1 olson Wi1lims Moore Smith Richard Jones Whitman Barbara Timothy David Sarah Paul Johnson Alice Henry Electrical Engineering 34 Computer Systema Economics Mechanical Engineering 80 Mathematics Computer Systems Accounting Business Management 78 87 90 105 114 The total number of records: 8 Press ENTER to continue... Figure 5: Add Records- handling duplicated student ID Add New Student Record Student ID 1234 Last Name First Name : Program Credits Add Anothe? ()es o (uit: This ID is already in the tile. Pre ENTER to continue. Figure 8: Search for Records Enter pattern t earch for : computer 2100 olson Timothy Computer Syatems 66 1480 Richard Johnson Computer Systems 90 Pre ENTER to continue Figure 10: Delete Records Enter pattern to delete: 222 Want to delete chese recorda? (es or (n)o: 2222:Allen:Carter:Economic:45

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions