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
serg [7]
3 years ago
3

5.21 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. Assume that the list will always contain less than 20 words. Each word will always contain less than 10 characters and no spaces. 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 an array. Keep in mind that the character 'a' is not equal to the character 'A'. Hint: To read in the character after the final word, add a space before %c: scanf(" %c", &searchCharacter);
Computers and Technology
1 answer:
ra1l [238]3 years ago
5 0

<u>Solution and Explanation:</u>

// code

#include <iostream>

#include <vector>

using namespace std;

// this function returns true if given character is in given word

bool has_char(string temp, char c)

{

    for (int i = 0; i < temp.length(); i++)  

       if (temp[i] == c)

          return true;

   return false;

}

int main()

{

   int n;

   vector<string> words(n);

   char character;

   // read integer

   cin >> n;

   // read list of words

   for (int i = 0; i < n; i++)

       cin >> words[i];

   // read a character

   cin >> character;

   // print those words which contains given character  

   for (int i = 0; i < n; i++)  

   {  

       if (has_char(words[i], character))  

           cout << words[i] << " ";  

   }  

   cout << endl;  

}

You might be interested in
Program documentation _____.
otez555 [7]

Answer:

Option A is the correct option for the following question.

Explanation:

Because Program documentation is the documentation in which contain the information about the software and also contain the logic of the modules of the program is user-friendly and convenient language about that application or the software and it is hard copy or any digital manual through which the programmer has to know about the application.

So, that's why the following option is correct.

7 0
3 years ago
. When a function template has two parameterized types, one as the return value, and one as an argument, then _____.
mart [117]

When a function template has two parameterized types, one as the return value, and one as an argument, then THE FIRST TIME MUST BE EXPLICITLY CODED.

Explanation:

  • The act of implicit and explicit coding, and implicit and explicit code, is defined by context of execution of additional behavior or type setting/casting. Specifically, implicit or explicit methods are defined by the contexts in which they are meant to be used.
  • The explicit coding discipline favors clear and explicit expression of intent in the code.
  • The uses-cases dictate the structure of the application. What the application does should not be implicitly hidden in an organization that the framework is trying to dictate you. Avoid having folders like /controllers, /views at the highest level of folders organization, in favor of folders containing features and use-cases: /categories, /products, etc.
  • Template parameter represents a type that has not yet been specified, but that can be used in the template function as if it were a regular type.

4 0
4 years ago
What are the data types used in C programming with examples
Zepler [3.9K]
I don’t really understand what you are trying to ask. Try posting a picture along with your question
5 0
3 years ago
Susie works for an architectural firm and the partners have always drawn the plans for projects by hand. Though Susie learned ho
Nookie1986 [14]

Answer:

A. CAD

Explanation:

Computer Aided Design, CAD, is basically for design. It involves the use of a computer to assist in the process of designing a part, circuit, building, etc.

It is also for drafting, here it makes use of a computer to assist in the process of communicating a technical drawing.

CAD has a couple of models in which its drawings and designs are represented. namey;

Solid Modeling: This is a type of 3D CAD process in which volumes of an object are represented not just its lines and surfaces.

Wireframe Modeling: This is a 3D CAD process that represents the lines and surfaces of a design.

Additive Modeling: This is a 3D modelling method in which each component is created individually and subsequent components are created as needed. This method is represented by construction processes such as welding, gluing, mechanical fastening, joinery.

Subtractive Modeling: This is a 3D modelling method in which a design is created by removing different geometric shapes from a solid block larger than the final design. The method is can best be represented by milling, drilling, turning, grinding, and other manufacturing processes.

Susie can make use of CAD and pitch its importance to his clients.

8 0
3 years ago
The most direct way for Jonothan to gain on-the-jib experience and earn money while attending school is to apply for
Sholpan [36]
A part-time job would provide on-the-job experience while also giving him a flexible schedule competing with school.
4 0
4 years ago
Other questions:
  • The "instance" relationship shows that something is an object of a ____.
    5·1 answer
  • Your boss bought a new printer with a USB 3.0 port, and it came with a USB 3.0 cable. Your boss asks you:
    7·2 answers
  • Normal wear and road conditions can take their toll on a car’s steering and suspension system, altering __________. A. wheel ali
    15·2 answers
  • Which of the following is NOT a strength of monetary policy?
    15·1 answer
  • Which of the following lines of code is syntactically correct?
    14·1 answer
  • Item 8 Item 8 Shelby Black runs a very successful hair salon in downtown Los Angeles. One of Shelby’s tasks is to input positive
    13·1 answer
  • 1)When the liquid is spun rapidly, the denser particles are forced to the bottom and the lighter particles stay at the top. This
    10·1 answer
  • Doctors at a regional hospital access an online database of patient records that is being developed and tested by a conglomerate
    13·1 answer
  • The identification of the technology management framework contain?
    6·1 answer
  • ____ the most popular word processing applications software<br><br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!