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
Leto [7]
2 years ago
8

5.23 LAB: Contains the character

Computers and Technology
1 answer:
torisob [31]2 years ago
7 0

Answer:

In C++:

#include<iostream>

#include<vector>

using namespace std;

int main() {

int len;

cout<<"Length: ";  cin>>len;

string inpt;

vector<string> vect;

for(int i =0;i<len;i++){

  cin>>inpt;

  vect.push_back(inpt); }

char ch;

cout<<"Input char: ";  cin>>ch;  

for(int i =0;i<len;i++){

  size_t found = vect.at(i).find(ch);  

      if (found != string::npos){

          cout<<vect.at(i)<<" ";

          i++;

      }

}  

return 0;

}

Explanation:

This declares the length of vector as integer

int len;

This prompts the user for length

cout<<"Length: ";  cin>>len;

This declares input as string

string inpt;

This declares string vector

vector<string> vect;

The following iteration gets input into the vector

for(int i =0;i<len;i++){

  cin>>inpt;

  vect.push_back(inpt); }

This declares ch as character

char ch;

This prompts the user for character

cout<<"Input char: ";  cin>>ch;  

The following iterates through the vector

for(int i =0;i<len;i++){

This checks if vector element contains the character

  size_t found = vect.at(i).find(ch);  

If found:

      if (found != string::npos){

Print out the vector element

          cout<<vect.at(i)<<" ";

And move to the next vector element

          i++;

      }

}  

You might be interested in
What is the viewing of the physical world with computer-generated layers of information added to it?
vazorg [7]

Answer:

Augmented Reality

Explanation:

<em>Augmented reality</em> enhances the real-world environment through images, sound, and text. Augmented reality is quite different from Virtual reality, because, virtual reality involves the interaction with the computer-generated environment while, Augmented reality models the real-world environment and enhances the results.

Even though it is considered by some as a futuristic technology, MIT Media Lab, particularly the Fluid Interfaces Group in 2009 introduced SixthSense, a device that projects images that can be manipulated using the fingers. Google also introduced the Google Glass in 2013 but pulled back in 2015, it projects images and videos on the user's lens and responds to voice command.

Augmented reality is gradually becoming part of our lives as it is being integrated into mobile devices and equipment.

In conclusion, Augmented Reality gives users the privilege to view the physical world with layers of computer-generated information.

3 0
3 years ago
Cans someone pls help me to do edhesive 2.5 code practice
Step2247 [10]

Answer:

Xjenwbsjhdbee

Explanation:

Shxbebwhddbd

4 0
3 years ago
Mario has a friend who uses assistive technology. Complete the paragraph to describe how Mario can make his document useful to h
pshichka [43]

Answer:

First options for all 3

Explanation:

3 0
3 years ago
Read 2 more answers
Advantage of social media for today'​
Lyrx [107]

Answer:

This social media advantage helps your business in numerous ways: You get to know them better: When you know your audience better, you can deliver more valuable content to them. ... You provide better customer service: A direct connection with your audience allows you to resolve issues easier

Explanation:

(happy to help)

6 0
3 years ago
What type of software is responsible for managing processor time and memory allocation?
yKpoI14uk [10]

Answer: Operating system

Explanation:

 The operating system is the type of software that are responsible for manage the processor time and also the memory allocation in the system. The operating system mainly deals with the processor time by scheduling the processor work done in the system.

The OS mainly control the system and then schedule the execution of various types of function by the central processing system (CPU). It also control the memory allocation in the system.

4 0
3 years ago
Other questions:
  • In a @return tag statement the description:
    13·2 answers
  • Andrew has data in cell E14 and the cell should be blank. Andrew should _____.
    15·2 answers
  • Let’s use that simple branch instruction to do the following: Load the two words declared in the data statement shown to the rig
    14·1 answer
  • Code in Java:
    6·1 answer
  • QUESTION 2
    10·1 answer
  • 1.
    15·1 answer
  • Which type of information should never be given out on social media?
    5·2 answers
  • Describe 6 difference of the types of computer<br>​
    13·1 answer
  • Type the correct answer in the box. Spell all words correctly. Which language should you use to add functionality to web pages?
    5·1 answer
  • A blueprint or a "print" needs to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!