read the content of the file in a string vector and then pass the vector to function doubleAS(). The function doubleAs is supposed to filter out those lines from file which contain two As. You are supposed to print those lines on the terminal.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This one.

main.cpp
read the content of the file in a string vector and then pass the
vector to function doubleAs(). The function doubleAs is supposed to
17
filter out those lines from file which contain two As. You are
supposed to print those lines on the terminal.
* /
18
19
//Desired output:
20
/*aaron
21
aaron's
22
abaissiez
23
abandon
24
abandon'd
25
abandoned
26
abase
27
abash'd
28
abate
29
abated
30
abatement
31
abatements*/
32
#include <iostream>
33
#include <fstream>
34
#include <string>
35
#include <vector>
auto doubleAs (std::vector<std::string> list)
{
//write your code here
36
37
38
39
}
int main() {
40
41
42
//declare a vector box with type string
43
//read from file
44
//iterate over the file content and push it into the vector
45
//Send the vector to above function and filter lines with double As
and print them in main.
Transcribed Image Text:main.cpp read the content of the file in a string vector and then pass the vector to function doubleAs(). The function doubleAs is supposed to 17 filter out those lines from file which contain two As. You are supposed to print those lines on the terminal. * / 18 19 //Desired output: 20 /*aaron 21 aaron's 22 abaissiez 23 abandon 24 abandon'd 25 abandoned 26 abase 27 abash'd 28 abate 29 abated 30 abatement 31 abatements*/ 32 #include <iostream> 33 #include <fstream> 34 #include <string> 35 #include <vector> auto doubleAs (std::vector<std::string> list) { //write your code here 36 37 38 39 } int main() { 40 41 42 //declare a vector box with type string 43 //read from file 44 //iterate over the file content and push it into the vector 45 //Send the vector to above function and filter lines with double As and print them in main.
test.txt
1
a
aaron
3
aaron's
4
abaissiez
5
abandon
abandon'd
7
abandoned
8
abase
9
abash'd
10
abate
11
abated
12
abatement
13
abatements
14
abbess
abbey
abbeys
15
16
17
abbot
18
abbots
19
abed
20
abe
Transcribed Image Text:test.txt 1 a aaron 3 aaron's 4 abaissiez 5 abandon abandon'd 7 abandoned 8 abase 9 abash'd 10 abate 11 abated 12 abatement 13 abatements 14 abbess abbey abbeys 15 16 17 abbot 18 abbots 19 abed 20 abe
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Distributed Database Concepts
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education