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
Select the correct answer. One of the functions of a data warehouse is to change table names to meaningful names. Which name is
Marianna [84]

Answer:

A. weekrep101

Explanation:

hope this worked and notice the update

6 0
2 years ago
Message queues allow for programs to synchronize their operations as well as transfer data. How much data can be sent in a singl
ser-zykov [4K]

The maximum size of a message queue is 16384 bytes for Linux. For IBM WebSphere MQ. this value is 4 MB.

<h3>What is the message queue?</h3>

The size of the message queue refers to the size (in bytes) that a message may have for a given operative system.

For example, the maximum value for IBM WebSphere MQ has been configured in four megabytes (4 MB).

In this case, when the message is higher than the set size (here 4 MB), then this message is returned.

Learn more about IBM here:

brainly.com/question/896257

6 0
2 years ago
What is the best definition of a network?
Cerrena [4.2K]

Answer:

C is the answer to this question.

3 0
2 years ago
Read 2 more answers
Given public class Fishing { byte b1 = 4; int i1 = 123456; long L1 = (long) i1; //Line A short s2 = (short) i1; //Line B byte b2
Aleksandr [31]

Answer:

Line E.

Explanation:

The  given program is as follows:

public class Fishing {

   byte b1 = 4; int i1 = 123456; long L1 = (long) i1;   //Line A

   short s2 = (short) i1;     //Line B

   byte b2 = (byte) i1;     //Line C

   int i2 = (int)123.456;    //Line D

   byte b3 = b1 + 7;     //Line E

   }

In the above code Line E will not compile and give following compilation error:

error: incompatible types: possible lossy conversion from int to byte

This error is coming because in Java b1 + 7 will be interpreted as int variable expression. Therefore in order to make code of Line E work the expression should be type casted as byte.  

The correct code will be as follows:

public class Fishing {

   byte b1 = 4; int i1 = 123456; long L1 = (long) i1;   //Line A

   short s2 = (short) i1;     //Line B

   byte b2 = (byte) i1;     //Line C

   int i2 = (int)123.456;    //Line D

   byte b3 = (byte)(b1 + 7);     //Line E

   }

5 0
2 years ago
Part of implementing Ken 7 Windows Limited new enterprise resource planning (ERP) software is ensuring all workstations and serv
spayn [35]

Answer:

Explanation:

1) The Functions a software application provide to keep a web browser secured includes:

a) The web browser should always be updated, you can keep it on "automatic update" option enable on your browser settings so that it will be automatically updated whenever the browser gets an update.

b) Always keep the third party cookies disabled because of the many unauthorized and phishing sites over the internet. This leaves the browser unsafe and cause higher security risk so block all the third party sites and cookies from the browser.

2) The Functions a software application prohibit to keep a web browser secured includes:

a) Do not store passwords on your web browser, deny the "store password" option on your browser settings. This is very important Even if you store passwords on your web browser do set a very strong master password to access all the stored passwords.

b) Don't ever click on unwanted and unknown hyperlinks. There will be many unsolicited attachments, files, etc over the internet please do not open or download it unnecessarily.

3) The functions a software application should provide to keep a web server secured includes:

a) Always using an application scanner. Whenever you install or download any new applications, scan the application before accessing it or opening it.

b) Install all the security patches to keep off hackers as they are many on the internet.

4) The Functions a software application should prohibit to keep a web server secured includes:

1) Uninstall an application that has not been used for long time, because they are actually of no use.

b) There may be scripts, files, setups, codes stored on the web server unknowingly so do check it and delete all the sample scripts, files and codes from the web server.

3 0
3 years ago
Other questions:
  • How does the use of modules provide flexibility in a structured programming design?
    14·2 answers
  • In this problem we consider sending real-time voice from Host A to Host B over a packet-switched network (VoIP). Host A converts
    12·1 answer
  • What tool listed below will be the most useful for developing presentation content?
    10·2 answers
  • A ____ is a type of program that uses a grid to organize and work with data.
    14·1 answer
  • How many bytes of information can be stored on a hard drive?
    7·1 answer
  • Walmart store wants to compare the sales of five of its stores. Write a complete program to ask the user to enter the sales for
    12·1 answer
  • Linda subscribes to a cloud service. The service provider hosts the cloud infrastructure and delivers computing resources over t
    10·1 answer
  • Huh? translate this please. (jk, I know what it says I just want to test everyone.)
    13·1 answer
  • I created a brainly account and forgot everything I mean everything so I cannot log back on and my debit Card is currently about
    11·2 answers
  • Cleo is new to object oriented programming. which type of action can be taken on on object?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!