Data structures and algorithms in C++
Data structures and algorithms in C++
2nd Edition
ISBN: 9780470460443
Author: Goodrich
Publisher: WILEY
Question
Book Icon
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.
    • 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.

Blurred answer
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education