Answered step by step
Verified Expert Solution
Question
1 Approved Answer
* PLEASE WRITE CODE IN C++ * PLEASE DIVIDE THE TWO SECTIONS OF LAB 10 IN C-STRING AND THE OTHER IN STRING CLASS: THE LAB
* PLEASE WRITE CODE IN C++
* PLEASE DIVIDE THE TWO SECTIONS OF LAB 10 IN C-STRING AND THE OTHER IN STRING CLASS:
THE LAB PROBLEM:
HERE IS THE SAMPLE PROBLEM 10-6:
Laboratory 10: Using C-String and String Classes Write a program that has an array of 11 string objects that hold people's names and phone numbers. Use the following data "Alejandra Cruz, 555-1223", ."Joe Looney, 555-0097", ."Geri Palmer, 555-8787", "Li Chen, 555-1212", "Holly Gaddis, 555-8878", "Sam Wiggins, 555-0998", ."Bob Kain, 555-8712" . "Tim Haynes, 555-7676", ."Warren Gaddis, 555-9037" ."Jean James, 555-4939", "Ron Palmer, 555-2783" Laboratory 10: Using C-String and String Classes The program should ask the user to enter a name or partial name to search for in the array Any entries in the array that match the string entered should be displayed For example, if the user enters "Palmer" the program should display the following names from the list .Geri Palmer, 555-8787 . Ron Palmer, 555-2783 This can be done using the C-String Class Program 10-6, shown in the appendix to this Lab, shows a similar example, indicating how this might be done using the C-String Class. . This can also be done using the String Class For that you will want to make use of the find() method shown on page 599 of ut with C++,9th Edition, and also shown in the appendix to this lab tar Tip: If a string Member Function fails to perform the procedure it was asked to do, it returns -1 to the program calling the function. Laboratory 10: Using C-String and String Classes Using Program 10-6, modify it so that it is able to do a search for the names in our contact list Note that the Array used here is a two dimensional Array of char The first dimensicn row dimension) represents the number of contacts in the Array The second dimension contains the Array of char holding the Contact information for one person Once you have that working, call the instructor so that you may receive credit for having accomplished this. Now, in the remaining time, repeat this search using the String Class instead. You may find that you will be able to execute this program using fewer steps than those used for the C-String class. Note that the Array used here is a one dimensional Array of Strings. Note also that you will be including the string Class instead of the cstring Class. Again, call the instructor when you have this version working OK
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