Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ please. Don't forget predefined linked-list libraries are not allowed. All linked-list functions are to be defined within your program and the age must be
C++ please. Don't forget predefined linked-list libraries are not allowed. All linked-list functions are to be defined within your program and the age must be from 18 to 40. Thank you
Your task for this assignment is to implement a linked list data structure in C++. 1. Implement a transaction-based linked list data structure using C++. The program will be interactive. A transaction will be entered at the command line after a short prompt and output will be displayed on the console display. A batch of transactions in a file will be processed using redirection. 2. A linked list of names and ages will be created, updated and managed using Add, Delete and List transactions. Each name is added in uppercase format. The age must be in the range of 18 to 40. 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, space, age. For example: A Paco 28. If the new name is not on the list and the age is valid, the name (in uppercase format) and age will be added such that names are in alphabetical order. When a new name is added, the message "name added" will be displayed. If the name is already on the list or if the age is out of range, the name will not be added, and the message name not added will be displayed. Delete - To delete a name and age from the list, enter a transaction in the form of D, space, name. For example: D Ling". If 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 the list, enter a transaction in the form of "L". Each name in the list will be displayed with the respective age on a line by itself. Quit - To terminate the program, enter a transaction in the form of Q. 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: 1 $ prog2 enter transaction: A Joan 24 name added enter transaction: A Manuel 35 name added enter transaction: A Abdul 50 name not added enter transaction: A Joan 21 name not added enter transaction: L JOAN 24 MANUEL 35 Enter transactionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started