Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Implement a transaction-based linked list data structure using Ch. The program will be Interactive. Data transactions will be entered at the command line following

image text in transcribed

image text in transcribed

1. Implement a transaction-based linked list data structure using Ch. The program will be Interactive. Data transactions will be entered at the command line following a displayed prompt and results will be displayed on the console. 2. A numerically organized linked list of names and ages will be created, updated and managed using Add, Delete and List transactions. These transaction types will be processed as follows: Add-To add a name to the list, enter a transaction in the form of "A", space, name (no spaces in the name), space, age. For example: A John 28" If the new name is not on the list, the name and age will be added such that the list of names is in ascending numerical order by age (e, youngest first, and the message "name added" will be displayed. A case-sensitive name comparison is used to see if the name is on the list. If the name is already on the list, the name will not be added, and the message "name not added" will be displayed. Delete - To delete a name and are from the list, enter a transaction in the form of "D", space, name (no spaces in the name). For example: "JoanIf the name is not on the list, the message "name not found" will be displayed. If the name is on the list, the name and age will be removed and the message "name deleted" will be displayed List - To display the names in age sequence (ie. youngest first), enter a transaction in the form "L" Each name in the list will be displayed with the respective age on a line by itself. Within a particular age, the sequence of the names having the same age is not relevant. Quit - To terminate the program, enter a transaction in the form of all In this assignment, predefined linked-list libraries are not allowed. All linked list functions are to be defined within your program. 3. Here is sample dialogue of the running program: $prog2 enter transaction: A Joan 54 name added enter transaction: A Manuel 45 name added enter transaction: A Abdul 50 name added enter transaction: Manuel 45 Abdul 50 Joan 54 Enter transaction: Q The program will be run at the command prompt by navigating to the directory containing the executable version of the program after the program is compiled. Redirection may be used to process multiple input transactions in a batch. For example: prog2

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

More Books

Students also viewed these Databases questions