Question: C++ LAB 4: Structures, Strings and Vectors Objectives: Completing this lab, the student will be able to: - Understand Structures - Understand Strings - Understand

C++C++ LAB 4: Structures, Strings and Vectors Objectives: Completing this lab, thestudent will be able to: - Understand Structures - Understand Strings -Understand Vectors You have a text file with following format: - The

LAB 4: Structures, Strings and Vectors Objectives: Completing this lab, the student will be able to: - Understand Structures - Understand Strings - Understand Vectors You have a text file with following format: - The first value is the company id. - The rest of the line is the company name. - The next line will be the company info A sample file is given below: 1 American University of Sharjah Address: Sharjah, UAE Telephone: +97165155555 2MBC Group Address: Dubai, UAE Telephone: +97143919999 3 Oracle Middle East Address: Dubai, UAE Telephone: +97143909010 You are asked to build a yellow pages application that allows you to load the company's information from a text file and search them by name A Skelton program is given below, where you have most of the functions without implementation and you need to implement them. \#include \#include \#include > \#include \& companies) \{ //TODO 2: This function should continuously read a company (id, name and info) from the stream is, and push it to the vectors \} 1 int find subName (vector\& companiess string substr) \{ //TOD0 3: This function should return the index of the compant in which substr is part of its name, look at the example run down for more details. If the nothing is found then this function should return -1; \} A sample run is given below: 1- Search by name 2- Exit 1 Please enter part of the name: AUS Nothing is found 1- Search by name 2- Exit 1 Please enter part of the name: American The Company is: ID {1} Name American University of Sharjah\} info \{Address: Sharjah, UAE Telephone: +97165155555 1- Search by name 2- Exit 1 Please enter part of the name: Oracle The Company is: ID {3} Name { Oracle Middle East\} info \{Address: Dubai, UAE Telephone: +97143909010\} 2 1- Search by name 2- Exit 4 Unknown option 1- Search by name 2- Exit 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!