Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ The name of the file must be library.cpp: A library has a sorted list, sorted by last name, of its members in a file

C++

The name of the file must be library.cpp:

A library has a sorted list, sorted by last name, of its members in a file with the following information for each member: First name, Last name, Member ID, and Telephone Number. The list contains 100 members. Write a program that reads the data from the file and store it in an array of structures. Display the database while reading from file.

The program should allow a librarian to retrieve users information based on last name or member ID search. So, the program should have a menu-driven user interface. In case of the last name search choice, call a function that will search all members that match and display them. Another function should be called for ID search option.If there is no match, a message saying so should be displayed.

Which searching algorithm would you choose for each type? Why?

Note: passing an array of structures is similar to passing any other type of arrays.

Download the file library_database.txt

library_database.txt:

Krystina Aikens 770686 488-248-9207 Jannet Allshouse 598300 158-127-6924 Majorie Bean 313889 370-546-1877 Karla Beaver 546535 166-377-6558 Ingeborg Boice 565702 288-104-7049 Kali Boulden 352708 350-151-5337 Owen Brashears 470804 635-861-8198 Natashia Brumer 552056 280-522-8017 Kenisha Celaya 834938 181-346-8906 Yasmine Considine 495233 623-713-6406 Randee Corson 526268 654-463-2011 Beverly Dangelo 676137 656-992-3948 Booker Danks 335302 666-609-4065 Dia Dannenberg 451322 148-389-0017 Ramonita Dejohn 564652 699-686-8201 Cleora Diez 872064 298-413-8528 Chere Dillard 578829 411-632-3141 Lakisha Dipaolo 360547 702-940-3820 Maile Discher 762224 376-701-0899 Mira Dock 633602 928-772-9721 Tiffiny Durrell 722176 926-302-6527 Antoinette Earhart 438791 741-675-5966 Delma Eisner 527915 124-960-2955 Dani Esteves 497975 741-648-1968 Dean Fetty 304848 706-930-3894 Janiece Figg 843860 773-104-3271 Roxane Florentino 322221 576-261-0580 Jama Frankel 534092 459-775-4804 Eli Fryman 487634 525-463-6149 Jolene Giffen 455471 863-484-8828 Josphine Gilliam 895201 511-926-7699 Nola Given 554097 205-588-2540 David Glowacki 672020 579-619-2775 Elbert Gorman 867054 896-273-7996 Sheryl Gregorio 406150 629-726-4934 Racquel Hamiton 415884 229-481-9483 Alease Hamlin 604458 890-994-8622 Loralee Hargrove 366958 585-386-9775 Ruthann Harvell 345462 523-975-0893 Eliseo Hendershott 844053 790-162-9692 Danyel Hinson 813408 787-389-4715 Loni Honey 555415 379-216-1443 Sheryl Humiston 309796 911-980-2084 Mohamed Hurlbert 640408 995-762-4079 Glayds Jamal 837206 546-979-6100 Beatriz Knorr 327554 139-447-8025 Chad Koren 647324 773-828-2806 Jacqulyn Lazar 391637 904-897-4878 Lavonne Lease 514740 366-920-9593 Darron Lora 845972 872-965-9522 Tynisha Lupercio 639029 560-463-7133 Ginger Lynam 358157 774-261-9253 Brittney Mattingly 563417 472-734-0766 Idalia Mcfate 885520 475-310-0693 Mercedes Mcgilvery 877607 255-523-5813 Magaret Mckenna 632493 278-926-0649 Alise Mehaffey 775681 785-893-1332 Golda Messina 631798 694-535-5685 Jacinto Morissette 890962 782-158-8432 Idell Mosqueda 304286 813-102-9120 Glynis Neal 354888 528-408-1114 Ana Nicley 613402 595-394-4649 Fredia Nordyke 661300 401-876-1560 Sena Padula 345737 510-609-4813 Ammie Panetta 423211 993-855-7227 Cecilia Patao 635278 504-336-9930 Jeffrey Patricia 880702 318-184-2996 Alena Peng 434350 808-891-6540 Bryant Peranio 733696 130-655-8816 Carolina Phillip 643144 862-388-0149 Renda Plyler 859716 639-943-8137 Missy Rey 339703 440-593-4716 Gennie Rinaldo 384366 390-400-8564 Ned Rosario 589868 141-677-4424 Coretta Rugh 688785 544-987-3552 Jackie Sattler 428056 159-541-2985 Mara Schisler 368299 403-967-1631 Maybell Sea 719758 237-398-4693 Ileen Seay 851804 967-734-7373 Irene Shurtliff 805834 659-135-9500 Saturnina Silvernail 390804 369-444-4594 Murray Stansberry 702323 748-576-9216 Ha Stonecipher 834722 736-568-1620 Dorla Tallman 518302 967-914-7039 Inger Tesar 396877 869-363-9348 Miguelina Texada 752538 802-678-4286 Pansy Threadgill 681877 764-362-2601 Jeana Tomei 421757 879-227-1683 Catherine Toppin 489432 765-924-8005 Mazie Umana 671393 118-869-4628 Terrell Urman 420934 181-249-9754 Racheal Varnado 434230 408-807-1876 Wilburn Villasenor 542712 205-849-8180 Sheri Wainright 417649 320-379-1614 Manuela Walkup 821365 574-806-8460 Matilde Weiser 745493 345-949-3595 Eliz Wessner 377028 838-778-4663 Hilario Westberry 380453 117-670-9133 Jorge Woolley 342305 705-183-1777 Yahaira Zemlicka 658067 202-232-5891

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago