Answered step by step
Verified Expert Solution
Question
1 Approved Answer
its in c++ Your program should accept text from standard input and write all results to standard output. The user will provide instructions to your
its in c++
Your program should accept text from standard input and write all results to standard output. The user will provide instructions to your program by typing text at a command prompt. Any commands which do not have a specified function should simply echo the command name and the parameters. For example, "PAINT Rect5" should output "Command: PAINT n Param 1: Rects n" (notice that the colons should line up making the output a little easier to read). You can assume that no command will have more than 8 parameters. Also, only the first four characters of any command should be considered significant and your program should recognize both upper and lower case commands. This means that PAINT, pain, Pain, and PAiNt are all equivalent The user plans to store a list of rectangles and associated information. This will include data like name, coordinates, and color. You should support all of the commands given in the following table. DUM FIND Find the INSENT shange Store the given reglemmary LOAD Loadcommands from filmom optimal REMOVE Removes the given rectangle from memory QUIT uits the program The data should all be stored in memory using an external linked list. When INSERT is called, you should determine if the name is new or a duplicate. If it is new, then you should create a new node and add it onto the end of the external linked list. If it is a duplicate, then you should update the data in the corresponding node. DUMP should walk through the entire linked list from head to tail printing all data for each node. FIND should search for the node that matches a given name starting at the head of the list and print the contents of the node it finds. When REMOVE is called, you should remove the specified node from your external linked list and free any memory associated with the node. If you choose to implement the LOAD command, make sure that it reads one line at a time and processes each line as if the user typed that line at the command prompt. The QUIT command should close all structures, clean up as necessary, and exit from the program Checklist Output a command prompt when waiting for user commands Undefined commands should echo their name and parameters Make sure that you add all necessary commands from the table Your output should look similar to the samples in the table Command DUMP is important because it aids in testing your code Command INSERT is critical and must work if you want a grade Command FIND is relatively straight forward so add it next Command REMOVE is most likely to cause problems so be careful Command LOAD is optional so add it only if you have time Your program should accept text from standard input and write all results to standard output. The user will provide instructions to your program by typing text at a command prompt. Any commands which do not have a specified function should simply echo the command name and the parameters. For example, "PAINT Rect5" should output "Command: PAINT n Param 1: Rects n" (notice that the colons should line up making the output a little easier to read). You can assume that no command will have more than 8 parameters. Also, only the first four characters of any command should be considered significant and your program should recognize both upper and lower case commands. This means that PAINT, pain, Pain, and PAiNt are all equivalent The user plans to store a list of rectangles and associated information. This will include data like name, coordinates, and color. You should support all of the commands given in the following table. DUM FIND Find the INSENT shange Store the given reglemmary LOAD Loadcommands from filmom optimal REMOVE Removes the given rectangle from memory QUIT uits the program The data should all be stored in memory using an external linked list. When INSERT is called, you should determine if the name is new or a duplicate. If it is new, then you should create a new node and add it onto the end of the external linked list. If it is a duplicate, then you should update the data in the corresponding node. DUMP should walk through the entire linked list from head to tail printing all data for each node. FIND should search for the node that matches a given name starting at the head of the list and print the contents of the node it finds. When REMOVE is called, you should remove the specified node from your external linked list and free any memory associated with the node. If you choose to implement the LOAD command, make sure that it reads one line at a time and processes each line as if the user typed that line at the command prompt. The QUIT command should close all structures, clean up as necessary, and exit from the program Checklist Output a command prompt when waiting for user commands Undefined commands should echo their name and parameters Make sure that you add all necessary commands from the table Your output should look similar to the samples in the table Command DUMP is important because it aids in testing your code Command INSERT is critical and must work if you want a grade Command FIND is relatively straight forward so add it next Command REMOVE is most likely to cause problems so be careful Command LOAD is optional so add it only if you have time Step 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