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
sineoko [7]
2 years ago
13

Write the definition of a function named count that reads all the strings remaining to be read in standard input and returns the

ir count (that is, how many there are) So if the input was:
hooligan sausage economy
ruin palatial
the function would return 5 because there are 5 strings there.
Computers and Technology
1 answer:
spayn [35]2 years ago
8 0

Answer:

The function written in C++

int str(string word) {

int count = 1;

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

 if(word[i] == ' ') {

  count++;

 }

}

return count;

}

Explanation:

This line defines the function

int str(string word) {

This line initializes count to 1

int count = 1;

This line iterates through the input string

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

This line checks for blank space

 if(word[i] == ' ') {

Variable count is incremented to indicate a word count

  count++;

 }

}

return count;

}

<em>See attachment for full program</em>

Download cpp
You might be interested in
Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
Korvikt [17]

A designer should always balance the placement of text and graphics and create room for every element to breathe. When this is followed, the flyer template will create a feeling of balance and calm.


Consider adding a border: Borders can help your flyer or newsletter stand out wherever it is placed. Selection of certain colors, Italics and ALL CAPS can draw attention to particular points in a text.


Boost contrast with style, color and font size: Always use font weight to differentiate sections of text. Many fonts offer regular, bold and light options for font weight.


Align text for a balanced look: A designer should consider using a grid system that contains intersecting vertical and horizontal lines that are often based on optimal proportions for the document’s size. Aligning text in the center will give a pleasant symmetrical look.






7 0
2 years ago
Read 2 more answers
In a print statement, you can set the __________ argument to a space or empty string to stop the output from advancing to a new
jeka94

In a print statement, you can set the End argument to a space or empty string to stop the output from advancing to a new line.

<h3>What is a Print statement?</h3>

A print "statement" is known to be a kind of statement that looks like a call to the make (print) or println process of the System.

Note that In a print statement, you can set the End argument to a space or empty string to stop the output from advancing to a new line so that it can work properly.

Learn more about  print statement from

brainly.com/question/25220385

#SJ1

6 0
2 years ago
What happens when the programmer tries to access an array cell whose index is greater than or equal to its logical size?
just olya [345]

Answer:

When a programmer tries to access an item in an array cell whose index is greater than or equal to the array's logical size, this data element or item is garbage. This means that currently, the item is not the part of the program's useful data. Garbage contains objects or data which will not be used by a program running on it. So the value returned could be either of the two:

  • Value would be an arbitrary or random number if it is an array of numbers. Arbitrary means that the value is not predefined or specified in advance.
  • Value returned would be null if it is an array of objects.

                                                           

 

3 0
3 years ago
What language do the Vikings speak in the game " For Honor"?
aivan3 [116]
In the game the Vikings speak icelandic
3 0
2 years ago
Read 2 more answers
Acess labeling windows​
Debora [2.8K]

Answer:

I got the same thing

Explanation:

8 0
2 years ago
Other questions:
  • How is the JOptionPaneclass used to display a dialog box that performs a yes/noconfirmation?
    10·1 answer
  • Jeanne writes a song, and Raul wants to perform
    6·2 answers
  • WHAT IS A COMPUTER ????
    14·2 answers
  • Edhesive coding practice 3.4​
    12·1 answer
  • How can you specify a page has the highest priority?
    7·1 answer
  • How does a Cloud-first strategy approach a client's migration to the Cloud?
    11·1 answer
  • How do you answer a question that's already been answered?
    5·1 answer
  • Draw a flowchart or write pseudocode to represent a program's logic that allows the user to enter a value. The program multiplie
    5·1 answer
  • Raul is a 13-year-old teenager interested in taking up photography as a new hobby. His dad wants to buy him a camera for his bir
    13·1 answer
  • Draw truth table for the following logic circuit:<br><br> (Please I really need help with this)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!