Fead the content of the file in a string vector and then count the number of a in the file content using function countAs () and use countLines () to count the number of lines in the file */ //Desired output Number of As: 32 // Number of lines: 20 #include #include #include #include auto countas (std::vector list) //write your code here } auto countlines(); } e int main() { //declare a vector box with type string //read from file //iterate over the file content and push it into the vector //Send the vector to above functions and count the number of a's and lines and print in main }

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 question.

test.txt
1
a
2
aaron
3
aaron's
4
abaissiez
abandon
6.
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
abel
Transcribed Image Text:test.txt 1 a 2 aaron 3 aaron's 4 abaissiez abandon 6. 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 abel
Fead the content of the file in a string vector and then count the
number of a in the file content using function countAs () and use
countLines () to count the number of lines in the file
*/
//Desired output Number of As: 32
// Number of lines: 20
8
9.
#include <iostream>
10
#include <fstream>
11
#include <string>
12
#include <vector>
auto countas (std::vector<std::string> list)
14 E {
13
//write your code here
}
auto countlines ();
15
16
17
18
}
20 E int main() {
19
21
//declare a vector box with type string
22
//read from file
23
//iterate over the file content and push it into the vector
24
//Send the vector to above functions and count the number of a's
and lines and print in main
}
25
26
67
Transcribed Image Text:Fead the content of the file in a string vector and then count the number of a in the file content using function countAs () and use countLines () to count the number of lines in the file */ //Desired output Number of As: 32 // Number of lines: 20 8 9. #include <iostream> 10 #include <fstream> 11 #include <string> 12 #include <vector> auto countas (std::vector<std::string> list) 14 E { 13 //write your code here } auto countlines (); 15 16 17 18 } 20 E int main() { 19 21 //declare a vector box with type string 22 //read from file 23 //iterate over the file content and push it into the vector 24 //Send the vector to above functions and count the number of a's and lines and print in main } 25 26 67
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Requirement Analysis
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