Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Ex: If the input is: 4 hello zoo sleep drizzle z then the output is: zoo drizzle To achieve the above, first read the list into a vector. Keep in mind that the character 'a' is not equal to the character 'A'.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 1TF
icon
Related questions
Question

5.23 LAB: Contains the character C++

 

Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character.

Ex: If the input is:

4 hello zoo sleep drizzle z

then the output is:

zoo drizzle

To achieve the above, first read the list into a vector. Keep in mind that the character 'a' is not equal to the character 'A'.

LAB
5.23.1: LAB: Contains the character
0/ 10
ACTIVITY
main.cpp
Load default template..
1 #include <iostream>
2 #include <vector>
3 using namespace std;
4
5 int main() {
7
/* Type your code here. */
8
9.
return 0;
10 }
11
Transcribed Image Text:LAB 5.23.1: LAB: Contains the character 0/ 10 ACTIVITY main.cpp Load default template.. 1 #include <iostream> 2 #include <vector> 3 using namespace std; 4 5 int main() { 7 /* Type your code here. */ 8 9. return 0; 10 } 11
5.23 LAB: Contains the character
Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The
output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will
contain the given character.
Ex: If the input is:
4 hello z00 sleep drizzle z
then the output is:
ZOO
drizzle
To achieve the above, first read the list into a vector. Keep in mind that the character 'a' is not equal to the character 'A'.
276482 1116448
Transcribed Image Text:5.23 LAB: Contains the character Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Ex: If the input is: 4 hello z00 sleep drizzle z then the output is: ZOO drizzle To achieve the above, first read the list into a vector. Keep in mind that the character 'a' is not equal to the character 'A'. 276482 1116448
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Parallel Processing
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning