Searching - a user should be able to search by ID or by item name create only one menu item for searching a user should be able to enter the name of the item using any case, (for example, sTRolleR) you may wish to store items in all lower/upper case to expedite the search write one search function that can search by ID and name and goes through the array of structs/objects only once show the entire record if found or an appropriate message if not Sorting - sort by any field in ascending order write one function to sort by any field using a parallel array of pointers use Bubble Sort is not the most effective but the easiest to modify. do not copy and paste sort code five times into the same function. sorting using pointers is faster because you have to swap pointers only, which are normally stored in 4 bytes each; it also allows you to preserve the original order of the items write a sort menu function to ask a user for the sort key, call the  sort function, and then call the print function - this way you'll have  reusable sort and print functions  do not write or use swap function to swap pointers - sort does enormous amounts of swap and executing a function is a computational expense. It takes 3-4 statements to swap pointers, do it in the sort function directly GENERAL NOTES correct the mistakes in lab #1 according to the feedback; if the same mistakes appear in lab #2, the points will be deducted again.  If you choose to have a submenu a submenu must have an option to go back to the previous menu or main menu . if a user got into a submenu by mistake, a user should be able to go back without executing other menu choices; for example, if a user entered Sort submenu, a user should be able to  go back to the previous menu or main without being forced to sort submenu should be implemented as a switch with enum; let it fall through                       switch(sortOption)   {              case ID:             case PRICE:             case NAME: sortInventory (pInventory, numRecs, sortOption) ; break;             case BACK_TO_MAIN <<"Going back to the main menu"; break;               default: cout<< " Invalid choice.  Try again"<

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

9/21/21 Updates are in blue 

Add the following functionality  and menu options to the previous lab

  • Searching - a user should be able to search by ID or by item name
    • create only one menu item for searching
    • a user should be able to enter the name of the item using any case, (for example, sTRolleR)
    • you may wish to store items in all lower/upper case to expedite the search
    • write one search function that can search by ID and name and goes through the array of structs/objects only once
    • show the entire record if found or an appropriate message if not
  • Sorting - sort by any field in ascending order
    • write one function to sort by any field using a parallel array of pointers
    • use Bubble Sort is not the most effective but the easiest to modify.
    • do not copy and paste sort code five times into the same function.
    • sorting using pointers is faster because you have to swap pointers only, which are normally stored in 4 bytes each; it also allows you to preserve the original order of the items
    • write a sort menu function to ask a user for the sort key, call the  sort function, and then call the print function - this way you'll have  reusable sort and print functions
    •  do not write or use swap function to swap pointers - sort does enormous amounts of swap and executing a function is a computational expense. It takes 3-4 statements to swap pointers, do it in the sort function directly

GENERAL NOTES

  • correct the mistakes in lab #1 according to the feedback; if the same mistakes appear in lab #2, the points will be deducted again. 
  • If you choose to have a submenu
    • a submenu must have an option to go back to the previous menu or main menu . if a user got into a submenu by mistake, a user should be able to go back without executing other menu choices; for example, if a user entered Sort submenu, a user should be able to  go back to the previous menu or main without being forced to sort
    • submenu should be implemented as a switch with enum; let it fall through              

        switch(sortOption)   { 
            case ID:
            case PRICE:
            case NAME: sortInventory (pInventory, numRecs, sortOption) ; break;
            case BACK_TO_MAIN <<"Going back to the main menu"; break; 
             default: cout<< " Invalid choice.  Try again"<<endl; }

  • Thoroughly test your program. Your grade partially depends on the quality of your test data.
  • the instructions on how to submit a programming project will be posted later
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 9 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY