Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

C++image text in transcribedimage text in transcribedimage text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students explore these related Databases questions