Data structures and algorithms in C++
2nd Edition
ISBN: 9780470460443
Author: Goodrich
Publisher: WILEY
expand_more
expand_more
format_list_bulleted
Question
Chapter 5, Problem 4P
EmployeeMap Class
Program Plan Intro
Program plan:
- Include the required header files.
- Use the “std” namespace.
- Create the class “Adapter_class”,
- Create the class variables.
- Define a function “insert()”.
- Push the item to the
vector . - Print the statement.
- Push the item to the
- Define a function “delete_item()”.
- Pop the item to the vector.
- Print the statement.
- Define a function “Find_Size()”.
- Print the size of the vector.
- Define a function “remove()”.
- Clear the vector.
- Define a function “Display()”.
- Push the item to the vector.
- Print the statement.
- Iterate a “for” loop.
- Print the elements of the vector.
- Define a function “main()”.
- Create the object of the class.
- Create the required integer variables.
- Iterate a “while” loop.
- Print the available options.
- Prompt the user to select the option.
- Scan for the value “option”.
- Define a “switch”.
- If the value of “option” is “1”.
-
- Prompt the user to enter the value to be inserted.
- Call the method “insert()”.
- Break the case.
- If the value of “option” is “2”.
-
- Print the statement.
- Call the method “insert()”.
- Break the case.
- If the value of “option” is “3”.
-
- Call the method “Find_Size()”.
- Break the case.
- If the value of “option” is “4”.
-
- Call the method “Display()”.
- Break the case.
- If the value of “option” is “5”.
-
- Call the method “Remove()”.
- Break the case.
- If the value of “option” is “6”.
-
- Call the method “exit()”.
- Break the case.
- Case default.
-
- Print the statement.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Data structures and algorithms in C++
Knowledge Booster
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education