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. For coding simplicity, follow each output word by a comma, even the last one. Add a newline to the end of the last output. 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'.

Answers

Answer 1

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++;

      }

}  


Related Questions

A web-based program that uses artificial intelligence techniques to automate tasks such as searches is called

Answers

A web-based program that uses artificial intelligence (AI) techniques to automate tasks such as web searches is called a: bot.

Artificial intelligence (AI) is also referred to as machine learning and it can be defined as a branch of computer science which involves the process of using computer algorithms to build a smart computer-controlled robot that is capable of automatically performing and handling tasks that are exclusively designed to be performed by humans or using human intelligence.

In the field of artificial intelligence (AI), a bot is an abbreviation for robot.

A bot is a web-based software program that assists an end user, or acts on his or her behalf, in the automatic performance of repetitive computer-related tasks such as web searches.

Read more: https://brainly.com/question/21656851

The network or networks within an AS communicate with protocols as well; these are called generically __________.

Answers

The protocol that is used by network or networks within an autonomous system (AS) to communicate with each other is generically called: interior gateway protocol (IGP).

A network refer to a set of interconnected computer systems (nodes) and the relational ties linking the computer systems together, especially for the purpose of exchanging (transmitting) data electronically.

An autonomous system (AS) can be defined as a network or group of networks that are administered or managed by an individual or business firm while using a single set of management rules.

Generally, an autonomous system (AS) typically uses a single (one) Internet Protocol (IP) routing protocol.

In this context, the protocol that is used by network or networks within an autonomous system (AS) to communicate with each other is generically called an interior gateway protocol (IGP).

On the other hand, an exterior gateway protocol (EGP) is the protocol that is used by autonomous systems (AS) to communicate with each other.

Read more: https://brainly.com/question/20629962

which of the following online creation tools will be used if a person wants to create a video presentation?

a. Piktochart
b. Prezi
c. Powtoon
d. Zamzar​

Answers

Answer:

C

Explaination:

Powtoon

W]hen a cryptographic system is used to protect data confidentiality, what actually takes place?

Answers

Answer: the Engine

Explanation:

once the engine take place its moves and goes faster

what do you think is the reason why there are two kinds of transmission mode in computer networking?

Answers

Answer:  Transmission mode or communication mode is referred to as transmission of data between two devices using a communication channel that includes an optical fiber, copper wires, wireless channels, and various storage media. The data that gets transmitted is in the form of electromagnetic waves. There are various ways of data transmission where the message that is passed is in the sequence of pulses using digital modulation. The transmission mode of data was first introduced in a computer networking system during the 1940s in modems, then in LANs, WANs, repeaters, and other networking system

is this what u are looking for?

How can middleware be used in angular.

Answers

Answer:

when a rquest comes in to the application

a steep reduction is memory available on the heap to the poiont where it is completly exhausted is known as a

Answers

Based on the information that is given, a steep reduction in the memory that's available is known as a memory leak.

A memory leak simply means a form of resource leak which occurs when a computer program manages memory allocations incorrectly in such a way that the memory that isn't needed anymore aren't released.

It should be noted that a memory leak is also a steady reduction in memory available on the heap to the point where it's exhausted. It can also be when an object that is stored in memory can't be accessed by the running code.

Read related link on:

https://brainly.com/question/25820385

which scenario describes a function provided by the transport layer?

Answers

The scenario that best describes a function provided by the transport layer of the open systems interconnection (OSI) model is: C. A student has two web browser windows open in order to access two web sites. The transport layer ensures the correct web page is delivered to the correct browser window.

OSI model is an acronym for open systems interconnection and it comprises seven (7) main layers, which typically starts from the hardware layers (layers in hardware systems) to the software layers (layers in software systems) and they include the following in sequential order;

Physical LayerData link LayerNetwork LayerTransport LayerSession LayerPresentation LayerApplication Layer

The transport layer accept data packets from session layer, breaks them into smaller units and then transmits (sends) them to the network layer, without any duplication of data.

In this scenario, a function provided by the transport layer of the open systems interconnection (OSI) model is transportation (transmission) of the correct web page (data) to the correct browser window (software application), especially through the use of source and destination port numbers assigned to the software application.

Read more: https://brainly.com/question/22883762

Your question is lacking the necessary answer options, so I will be adding them here:

A. A student is using a classroom VoIP phone to call home. The unique identifier burned into the phone is a transport layer address used to contact another network device on the same network.

B. A student is playing a short web-based movie with sound. The movie and sound are encoded within the transport layer header.

C. A student has two web browser windows open in order to access two web sites. The transport layer ensures the correct web page is delivered to the correct browser window.

D. A corporate worker is accessing a web server located on a corporate network. The transport layer formats the screen so the web page appears properly no matter what device is being used to view the web site.

A business is having trouble keeping up with the competition. They cannot
respond to their customers like the competition. Which type of system will
likely be able to help them solve this issue?
A. Transaction processing system
B. Management communication system
C. Decision support system
D. Management information system

Answers

Answer:

Decision support system is the answer

Explanation:

Molly needs to access a setting in microsoft windows group policy to change the type of a network to which a computer is attached. Which setting must molly change?.

Answers

A computer is made up of different network. The setting that molly must change is network type.

A computer network is known to be a group of computers that are linked to each other so as to help the computer to communicate with another computer and share their resources, data, and applications.

A computer network can be classified based on their sizes. A computer network is of four types. They are:

LAN(Local Area Network)

PAN(Personal Area Network)

MAN(Metropolitan Area Network)

WAN(Wide Area Network)

Learn more from

https://brainly.com/question/14200752

4. Each mobile device described in this chapter requires that the user have a/an ____________________ associated with services offered by the publisher of the mobile OS in use on the device.

Answers

All mobile devices requires that end users have an account that is associated with services offered by the publisher of the mobile operating system (OS) installed on the device.

A mobile device can be defined as a small, portable, programmable electronic device that is designed and developed for the transmission and receipt of data signals (messages) over a network. Thus, a mobile device must be designed as a handheld device with communication capabilities.

Additionally, mobile devices such as smartphones have a mobile operating system (OS) installed on them, so as to enable them perform various tasks such as:

Taking pictures and creating video files.Typing and sending both text and multimedia messages.Browsing the Internet.Making both audio and video calls.

As a general rule, all mobile devices requires that end users have a registered account associated with the services offered by a publisher of the mobile operating system (OS) installed on the device. This registered account serves as a unique identifier and it connects an end user with the publisher of the mobile operating system (OS).

Read more: https://brainly.com/question/4922532

You have been asked to create a file that will contain a series of Windows command-prompt commands that automate the creation of a VPN client that connects to your company VPN server. What type of file should you create

Answers

Based on the information given, the type of file that the user should create is the batch file.

Batch file simply means a script file in Microsoft Windows. A batch file consists of a series of commands that will be executed by the command-line interpreter.

Since the user has been asked to create a file that will contain a series of Windows command-prompt commands that automate the creation of a VPN client, the batch file will be vital in this case.

Read related link on:

https://brainly.com/question/25520771

A programmer wants to write code that directly accesses the computer’s hardware. Which is the best type of language for the programmer to use?.

Answers

Answer:

Assembly is the programming language that directly accesses the computer’s hardware.

True or false: Because there are so many different network configurations, operating systems, and strategies, it is a challenge for organizations to get their networks to work together effectively and securely.

Answers

Answer:

I think the answer is "true."

Explanation:

Because as you may know, there are many hackers and types of people who get private information from people. And different organizations must work together like you said. This requires a lot of brainstorming and connecting. It's a challenge because it needs many ideas, needs a lot of time for thinking, and making sure whatever they are doing is safe. (This is in my opinion)

PLEASE HELP ME

(b) When a computer systems RAM becomes full it can use virtual memory.
Explain what happens if the computer does not have any virtual memory.

Answers

Answer:

it won't be able to run

Explanation:

because computer runs on physical memory

If a computer does not have any virtual memory, the consequences of running out of physical RAM can be quite problematic.

When the RAM becomes full, the operating system relies on virtual memory as a way to supplement the physical memory shortage. Without virtual memory, the system would have no way to manage or accommodate the excess data that needs to be stored temporarily.

As a result, the computer would likely start experiencing severe slowdowns, freezing, or crashing when attempting to run applications that require more memory than is available.

In extreme cases, the system might even become unresponsive or display error messages indicating a lack of memory. Virtual memory acts as a safety net, allowing the computer to continue functioning by utilizing a portion of the hard drive as temporary memory storage when physical RAM is exhausted.

Without this essential feature, the computer's ability to multitask and handle memory-intensive tasks would be severely hindered.

Learn more about virtual memory, click;

https://brainly.com/question/30756270

#SPJ3

Can anyone help me with this please I’ll give you 30 points

Answers

Answer:

HTTPS

Explanation:

!!ALWAYS USE HTTPS!!

You are the network administrator for a growing business. When you were hired, the organization was small, and only a single switch and router were required to support your users. During this time, you monitored log messages from your router and switch directly from each device's console.The organization has grown considerably in recent months. Now you manage eight individual switches and three routers. It's becoming more and more difficult to monitor these devices and stay on top of issues in a timely manner.What should you do?A- Use a remote access utility such as SSH to access router and switch consoles remotely.B- Hire additional resources to help monitor and manage your network infrastructure.C- Use syslog to implement centralized logging.D- Consolidate network resources down to one or two switches.

Answers

Answer:

-use syslog to implement centralized logging

Explanation:

What is a recent innovation in edge computing enhanced by 5G?.

Answers

A recent innovation in edge computing enhanced by 5G is placing computing resources physically inside the network infrastructure.

5G is the fifth generation of mobile communications operating on the basis of telecommunication standards, following the existing 4G.

5G technologies must provide higher bandwidth than 4G technologies, which will ensure greater availability of mobile broadband, as well as the use of device-to-device modes (direct connection between subscribers).

It also allows ultra-reliable large-scale systems communication between devices, as well as less latency, higher speed, and less battery power consumption than 4G equipment.

Learn more about computers in https://brainly.com/question/24836371

jelaskan tiga kemungkinan sebab pengasah pensil itu tidak dapat berfungsi secara tiba-tiba (translate: explain three possible reasons why the pencil sharpener may not work suddenly) pls help me​

Answers

Explanation:

Internal gear wear must be significant (visually obvious) to be the cause of off-center sharpening. Cutter carrier is rotating but the pencil is not sharpening (doesn't feel like the cutter is engaging the pencil) This is usually caused by a foreign object (e.g., an eraser or broken pencil lead) inside the pencil bore.

Question # 2
Multiple Select
Which of the following statements are true regarding feedback? Select 3 options.

-Feedback is used exclusively for marketing purposes.

-Feedback includes only the unsolicited opinions of customers.

-Feedback can be gathered from everyday activities, like support calls.

-The type of feedback gathered, depends on the phase of the project and the goals for the feedback.

-Customer surveys can be used to ask specific questions.

Answers

The statement that are true regarding feedback are:

c. Feedback can be gathered from everyday activities, like support calls.

d. The type of feedback gathered depends on the phase of the project and the goals for the feedback.

e. Customer surveys can be used to ask specific questions.

What are feedbacks?

Feedbacks are the return compliments or suggestions that are given by customers after taking any service by any company. The business updates its products in response to client input.

He requested input from his employer. According to the sensors' feedback, the computer adjusts. The microphone was providing some input to us. These feedbacks are important for the company or any other person to improve herself.

Therefore, the correct options are c, d, and e.

To learn more about feedback, refer to the link:

https://brainly.com/question/26994432

#SPJ2

EDI, ________, smart cards, and digital certificates are designed to support safe and secure online transactions.

Answers

Electronic data interchange (EDI), e-cash, smart cards, and digital certificates are all designed and developed to protect and support safe and secure transactions over the Internet (web).

In Business management, e-commerce can be defined as a business model which involves the buying and selling of goods (products) over the Internet (web), as well as the use of an online medium for payment.

Generally, it is necessary that adequate measures are put in place to protect and support safe and secure transactions over the Internet (web), so as to prevent the unauthorized use of a customer's confidential information such as password.

In Cybersecurity, some of the frameworks and technologies designed to provide safe and secure transactions over the Internet (web) include:

Electronic data interchange (EDI).e-cash. Smart cards.Digital certificates.

Read more: https://brainly.com/question/24112967

you need to use task manager to analyze memory utilization on a windows system. for example, you need to see how much system ram is currently in use and how much is available. click on the tab in task manager that you would use to do this.

Answers

Answer:

Performance tab

Explanation:

If you press on the performance tab you should be able to see how much memory is in use and how much is free. For example 50% or 8GB/16GB

Create an application that prompts the user for a number and then displays the numbers 1 through the number entered, each on a separate line. Below the numbers, the sum is displayed.

Answers

Answer:

In Python:

start = num(input("Enter a number: "))

sum = 0

for x in range(1, start+1):

sum += x

print (x)

print ("Final Sum: " + sum)

Answer:

import java.util.Scanner;

public class NumberSum {

public static void main(String[] args) {

// TODO Auto-generated method stub

int num, sum=0,num1=0;

Scanner input=new Scanner(System.in);

 

System.out.println("Enter a number");

num=input.nextInt();

input.close();

 

do{

System.out.println(num1);

num1+=1;

sum+=num1;

}while(num1<=num);

System.out.println(sum);

}

}

The implementation stage of the SDLC is when the system is moved into operation where it can be used. What stage PRECEDES the implementation stage and what happens in this preceding stage

Answers

The stage that precedes the implementation stage of SDLC is testing and it involves checking the functionality of the system.

System design involves the process of determining an overall system architecture, which typically comprises the following:

Hardware.End users.Physical processing components.Software.Communication channel.

Generally, there are seven (7) main stages in the systems development life cycle (SDLC) model and these include:

1. Planning.

2. Analysis.

3. Design.

4. Development.

5. Testing.

6. Implementation.

7. Maintenance.

From the above, we can deduce that the stage which precedes the implementation stage of SDLC is testing.

During the testing stage of SDLC, a quality assurance (QA) expert checks the system to determine whether or not it is functioning properly before it is deployed for operation, which is where the system can be used.

Read more: https://brainly.com/question/20813142

Power Supply

Description :

Answers

A device that supplies power to electronic equipment which; is sometimes called A, B, or C according to its purpose of heating vacuum tube cathodes, producing electron current flow in plate circuits, or applying a direct voltage in grid circuits.

Explanation:

Not exexactly sure on what your asking

Help please match them if you just put a link or say “I don’t know but thanks for the points” I’ll report your answer and you won’t get the brainliest

Answers

Answer:

Input: The user clicks a button

Output: A song is played

User interface: A screen with buttons, images, and text

Explanation:

Three teams (Team A, Team B, and Team C) are participating in a trivia contest. Let scoreA represent the number of correct questions for Team A, scoreB represent the number of correct questions for Team B, and scoreC represent the number of correct questions for Team C. Assuming no two teams get the same number of correct questions, what code segments correctly displays the team with the highest number of correct questions?

Answers

To make comparison between a set of variables, the if-else statement is usually employed, Hence, the correct code segment which displays the team with the highest number of correct questions is the option A.

First it checks if ScoreA > ScoreB ; - - - #1st blockIf True ; then check if ScoreA > ScoreC ;

Then TeamA will be the highest, if otherwise then it will be TeamC

If the 1st block is false, then ScoreB > ScoreA;then check if ScoreB > ScoreC ;Then TeamB will be the highest, if otherwise then it will be TeamC

Hence, the correct option is A.

Learn more : https://brainly.com/question/25675806

Answer:

A

Explanation:

Lloyd works for a graphic design company. He needs a monitor that accurately represents colors. Lloyd's monitor recently failed, and you have been asked to purchase a new one. You have been asked to find a monitor with a fast pixel refresh rate, low energy consumption, and very accurate colors representation.

Required:
What types of display devices will BEST meet the requirements requested?

Answers

OLED simply stands for Organic Light-Emitting Diode. It is often regarded as a type of technology that uses LEDs in which the light is produced by organic molecules. The types of display devices will best meet the requirements requested OLED.

They are often regarded as organic LEDs that are used to produce display panels.

OLED displays are produced with a number of organic thin films between two conductors. It has a form of a simple design that has a lot of merits over other display technologies.

These technology are mostly used today in mobile devices as they give a better image quality.

Learn more from

https://brainly.com/question/14781150

Ask what kind of pet the user has. If they enter cat, print "Too bad...", if they enter dog, print "Lucky you!" (You can change the messages if you like). Once this works, add other pets. (Iguana, Pig, Rabbit...)

Answers

Answer:

Explanation:

a = input("what kind of pet the user has")

if a == 'cat':

  print("Too bad")

elif a == 'dog':

   print("Lucky you!")

RDP connection from outside the network to a server inside the network. Which network device will a network administrator MOST likely configure to allow this connection? Hub Switch Firewall

Answers

Answer:

Firewall

Explanation:

The firewall might block the Remote Desktop Protocol (RDP) connection. This is because hackers could use open connections to brute force passwords or control an infected computer. The firewall ensures that only authorised connections occur.

Other Questions
The sales tax rate is 10% if ruby buys a toaster priced at 34.72 what will be the total cost including tax what never-before-seen language was discovered at knossos? Imagine you were going to use a dedicated workstation for an animation job rather than a personal PC. What differences would you expect to see between a dedicated 3D animation workstation and a typical PC Find the equation of the exponential function represented by the table below:x y0 0.011 0.032 0.093 0.27y= What effect does the narrator create by repeating the phrase "hung it"?A. It encourages the reader to sympathize with the narrator and hisemotions.B. It increases the violence of the action and highlights itsimportancec. It helps the reader feel sorry for the cat and what it had to endure.O D. It allows the reader to understand the reason behind the narrator'sactions. PLEASE HELP ME!! I AM BEGGING YOUChien Wu went to see Chief Yu. Chief Yu said, "What was Chung Shih telling you the other day?" Chien Wu said, "He told me that the ruler of men should devise his own principles, standards, ceremonies, and regulation, and then there will be no one who will fail to obey him and be transformed by them." Chief Yu said, "This is bogus virtue! To try to govern the world like this is like trying to walk the ocean, to drill through a river, or to make a mosquito shoulder a mountain! When the sage governs, does he govern what is on the outside? He makes sure of himself first, and then acts. He makes absolutely certain that things can do what they are supposed to do, that is all. The bird flies high in the sky where it can escape the danger of stringed arrows. The field mouse burrows deep down under the scared hill where it wont have to worry about men digging and smoking it out. Have you got less sense than these two l 4. If the slope of one side of a triangle is , what is the slope of theALTITUDE that intersects this side?a.3/2b. -2/3C.-3/2d. None of the above What are FOUR things the delegates to the convention had in common?a) They wanted to reunite with the British.b) They knew that the nation needed a stronger central government, though they were not willing to give up the sovereignty and autonomy of their states.c) They wanted peace with the other statesd) They wanted a representative government that was divided into executive, legislative, and judicial branchese) They wanted a government that was representative of the will of the people but would be structured in such a way that it would not collapse into mob rule. solve pls brainliest Which of the following statements is TRUE?Bell's palsy comes on suddenly.The worst symptoms associated with Bell's palsy occur within 48 hours.Bell's palsy usually requires no treatment in order to recover.*All of the above what is the meaning of life? what are we here for? why does it end so fast AND IM TALKING ABOUT SUMMER BRAKE. People protesting outside Amazon over labor conditions and wages of its workers. a Individual Rights b Republicanism c Checks and Balances d Limited Government A global resources company uses data-intensive, cloud-based simulation software, but users in remote locations find that the responsiveness is poor due to the amount of data being transferred to and from the cloud. In response, the company decides to deploy multiple instances of the application in locations closer to the end users. How much profit will a store make on the sale of a flat screen TV that is marked up by 30% and then sold at a 20% discount if the original price of the TV is $1500? What is the value of f(x), if x is -8? This painting illustrates the exploration of a major body of water in the UnitedStates by Robert Cavelier de La Salle. Which body of water did he explore andfor what country?Hudson River for the NetherlandsBSt. Lawrence River for the BritishGulf of Mexico for SpainDMississippi River for France Help me please also sorry for the bad camera I'm on my tablet rn Describe the transformation from the parent function: y = x.y = 1/2x What in the cinderella story suggests its origin, according to the author? why is her theory uncertain?. Choose all options that apply.