1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kolbaska11 [484]
4 years ago
12

Write a program that has an array of at least 50 string objects that hold people’s names and phone numbers. The program then rea

ds lines of text from a file named phonebook into the array. The program should ask the user to enter a name or partial name to search for in the array. All entries in the array that match the string entered should be displayed-- thus there may be more than one entry displayed. The program prints the message "Enter a name or partial name to search for: " and then after the user enters some input and hits return, the program skips a line, and prints the heading: "Here are the results of the search:", followed by each matched string in the array on a line by itself. Input Validation: None
Computers and Technology
1 answer:
Readme [11.4K]4 years ago
8 0

Answer:

See explaination

Explanation:

#include <iostream>

#include <fstream>

#include <string>

using namespace std;

int main()

{

const int SIZE = 50;

string phoneDirectory[SIZE];

int size=0;

string name; //name to look for

ifstream inFile;

inFile.open("phonebook");

while (!inFile.fail()) {

getline(inFile,phoneDirectory[size]);

size++;

}

inFile.close();

// Get a name or partial name to search for.

cout << "Enter a name or partial name to search for: ";

getline(cin, name);

cout << "\nHere are the results of the search: " << endl;

int numberEntriesFound = 0;

for (int k = 0; k < size; k++)

{

if (phoneDirectory[k].find(name.data(), 0) < phoneDirectory[k].length())

{

numberEntriesFound ++;

cout << phoneDirectory[k] << endl;

}

}

if (numberEntriesFound == 0)

cout << "\nNo Entries were found for " << name;

return 0;

}

You might be interested in
Adam, a flower shop owner, wants to drive phone calls to his store. Which Adwords tool should he use to track how many calls res
Kipish [7]

Answer:D)Conversion tracking

Explanation:Conversion tracking is the tool that helps the user to know about the interaction of the ad given by him with customer. It helps in the tracking in the ways like calls from ads, call conversion importing,mobile website gaining the number of clicks etc.

Thus,  Adam needs to use the conversion tracking tool which for driving the calls towards his store.He can track the effectiveness of the ad which drives the calls.

Other options given are incorrect because they cannot keep the record of the  ads seen by the customer with the help of tracking. Thus the correct option is option(D).

8 0
3 years ago
Question, who wants 100 points?
Alexandra [31]
Me and well thank you
8 0
3 years ago
Read 2 more answers
Which of the following can track your pulse and heart rate, as well as accept calls and display notifications from a smartphone?
alexgriva [62]
The answer is a smart watch most likely the apple or Samsung versions both now offer voice calls and health tracking sensors on the bottom side of the watch most popular is the apple as the company grows more everyday
8 0
3 years ago
Jeremy forgot where he saved a certain file on her computer. Therefore, he searches for all files with a .jpg file extension. Wh
Irina-Kira [14]
The jpg (or jpeg) extension stands for <span>Joint Photographic Experts Group. A file with this extension is an image, usually a photo. Other types of images are better stored using a lossless format.</span>
4 0
3 years ago
Read 2 more answers
You have decided to use a worksheet to keep track of your monthly income and expenses. What categories might your worksheet incl
Wewaii [24]

The steps to set up your own budget include:

<span>1= Create a new Excel worksheet2= Determine your income3= Determine your fixed expenses4= Determine your variable expenses5= Make provision for funds you may need6= Create your financial goals7= Ideas on how to kick start your emergency fund8= Analyze your budget9= Track your expenses</span>
6 0
3 years ago
Other questions:
  • Identifying Characters
    11·2 answers
  • Which of the following would you click to access Help and Support?
    6·2 answers
  • Why might you need to convert a file to another file type?
    14·1 answer
  • When a user runs an application, what transfers from a storage device to memory?
    15·1 answer
  • In a set associative cache memory, if the number of ways (lines) in a set is doubled while keeping the cache size and line size
    13·1 answer
  • Before you enable data deduplication, what tool can you use to determine if data deduplication would benefit the tested volumes
    11·1 answer
  • While doing online research you enter this keyword search with a truncation character: man* Which of the following would not be
    15·1 answer
  • Account numbers sometimes contain a check digit that is the result of a mathematical calculation. The inclusion of the digit in
    13·1 answer
  • Declare an array named tax rates of five elements of type double and initialize the elements (starting with the first) to the va
    12·1 answer
  • I have an LG phone. I also haven't paid my phone bill yet, so I can't send text messages. I playfully texted texts to people and
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!