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
Anna35 [415]
3 years ago
9

Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. T

he 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. For example, if the input is 4 hello zoo sleep drizzle z The output should be Zoo 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
Computers and Technology
1 answer:
guapka [62]3 years ago
6 0

Answer:

/Include required header file.

#include <stdio.h>

//Define the function isWordContainChar() having the

//required parameters.

int isWordContainChar(char* req_word, char search_char)

{

//Declare required variable.

int i;

//Start a for loop to traverse the string given in

//the function parameter.

for(i = 0; req_word[i] != '\0' ; i++)

{

   //If the current character in the gievn word is

   //matched with the character which needs to be

   //found in the word, then return 1.

   if(req_word[i] == search_char)

   {

     return 1;

   }

 }

//Otherwise, return 0.

return 0;

}

//Start the execution of the main() method.

int main(void)

{

//Declare the required variables.

int num_words, index, word_index;

char str_word[20][10];

char searchCharacter;

//Prompt the user to enter the number of words.

scanf("%d", &num_words);

//Prompt the user to enter the required words using a

//for loop and store them into an array.

for(index = 0; index < num_words; index++)

{

   scanf("%s", str_word[index]);

}

//Prompt the user to enter a required character which

//needs to be found in a word.

scanf(" %c", &searchCharacter);

//Traverse the words stored in the array using a for

//loop.

for(index = 0; index < num_words; index++)

{

   //Call the function isWordContainChar() with

   //required arguments in rach iteration and if the

   //value returned by this function is not 0, then

   //display the current string in the array.

   if(isWordContainChar(str_word[index],

   searchCharacter) != 0)  

   {

     printf("%s\n", str_word[index]);

   }

}

return 0;  

}

You might be interested in
Question 6 (1 point)
Marysya12 [62]
<h2>answers</h2>

Extranet

wifi create extranet so that our mobile network runs smoothly. it can create lan,wan also

7 0
3 years ago
Which two standards below represent newer versions of stp??
valina [46]
Standard Tree Protocol (STP) is a networking protocol that was made by Radia Perlman. It makes a single path over a network, averting any loops from happening. Even if there are multiple paths to the same destinations. It has two never versions which is 802.1s and 802.1w.
8 0
3 years ago
Which element is included in the shot breakdown storyboard? Which element is included in the shot breakdown storyboard?
VladimirAG [237]

Answer: jump out

Explanation:

Took the test and it was correct

5 0
3 years ago
Best practices and trends for technology integration
cluponka [151]

Answer:

Technology use must be aligned to the standards. Technology must be integrated into daily learning,

Explanation:

Technology use must be aligned to the standards. Technology must be integrated into daily learning, not used as an add-on to instruction to match personal learning needs. Students need opportunities to use technology collaboratively. Technology must support project based learning and include real-world simulations.

3 0
2 years ago
A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi
UkoKoshka [18]

Answer:

The program in Python is as follows:

qty = int(input("Quantity: "))

price = 100 * qty

if qty >1000:

    price = (100 - 0.10 * 100) * qty

print("Cost: "+str(price))

Explanation:

This prompts the user for the quantity

qty = int(input("Quantity: "))

This calculates the price or cost, without discount

price = 100 * qty

This checks if the quantity is greater than 1000

if qty >1000:

If yes, this calculates the price or cost, after discount

    price = (100 - 0.10 * 100) * qty

This prints the calculated cost

print("Cost: "+str(price))

4 0
2 years ago
Other questions:
  • Ming is building an inexpensive computer to use for her online classes, and needs to purchase Windows. What is the most cost-eff
    8·1 answer
  • Programmers insert documentation called facts into the program code.? <br> a. True <br> b. False
    9·1 answer
  • 1⁰=?<br> Is equal to...........
    12·2 answers
  • Your computer has a single hard disk w/ a single volume used by the C:\ drive. You have previously upgraded the disk to a dynami
    6·1 answer
  • Can a idler gear increase or decrease torque?
    7·1 answer
  • Using complete sentences post a detailed response to the following.
    13·1 answer
  • The software that displays the resulting web pages is​
    9·1 answer
  • Write an algorithm to find the average of three numbers: 10, 20, 30
    7·1 answer
  • Use the drop-down menus to complete each statement. Two main versions of Outlook are the desktop app and the app. The has limite
    15·2 answers
  • What are the difference among the whole note, half note and quarter note ? (this is music)
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!