Write the definition of a function named count that reads all the strings remaining to be read in standard input and returns their 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.

Answers

Answer 1

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;

}

See attachment for full program


Related Questions

This assignment involves writing a Python program to compute the average quiz grade for a group of five students. Your program should include a list of five names. Using a for loop, it should successively prompt the user for the quiz grade for each of the five students. Each prompt should include the name of the student whose quiz grade is to be input. It should compute and display the average of those five grades and the highest grade. You should decide on the names of the five students. Your program should include the pseudocode used for your design in the comments.

Answers

Answer:

Here is the Python program along with the comments of program design

#this program is designed to compute the average quiz grades for a group of five students  

students = ["Alex", "John", "David", "Joseph", "Mathew"] #create a list of 5 students  

grades = []  # create an empty list to store the grades in  

for student in students: #loop through the students list  

   grade = input("Enter the quiz grade for "+student+": ") #prompt the user for the quiz grade of each student

   #store the input grades of each student to grade

   grades.append(int(grade))  # convert the grade to an integer number and append it to the list  

print("Grades are:", grades) #display the grades of five students  

average = sum(grades) / len(grades) #compute the average of five grades  

print("The average of grades is:", average) #display the average of five grades  

highest = max(grades) #compute the highest grade

print("The highest grade is:", highest) #print highest grade  

Explanation:

The program first creates a list of 5 students who are:

Alex

John

David

Joseph

Mathew

It stores these into a list named students.

Next the program creates another list named grades to store the grades of each of the above students.

Next the program prompts the user for the quiz grade for each of the five students and accepts input grades using input() method. The statement contains student variable so each prompt includes the name of the student whose quiz grade is to be input. Each of the grades are stored in grade variable.

Next the append() method is used to add each of the input grades stored in grade to the list grades. The int() method is used to first convert these grades into integer.

Next print() method is used to display the list grades on output screen which contains grades of 5 students.

Next the average is computed by taking the sum of all input grades and dividing the sum by the total number of grades. The sum() method is used to compute the sum and len() method is used to return the number of grades i.e. 5. The result is stored in average. Then the print() method is used to display the resultant value of average.

At last the highest of the grades is computed by using max() method which returns the maximum value from the grades list and print() method is used to display the highest value.

The screenshot of the program and its output is attached.

What is a backdoor?
A. A different sign-in page to log into a computer
B. An unrecognized entry into a computer or system
C. A fake version of software to access a computer system
D. An administrative login feature of computer software

Answers

B. Generally backdoors are logins/access to something without permission and without admins knowing.

______ means locating a file among a set of file​

Answers

Answer:

computer files

Explanation:

Which filter allows you to impart a stamping or raising effect in an image?

A. Stylize filter
B. Noise filter
C. Sharpen filter
D. Blur filter
E. Texture filter

Answers

Answer:

A. Stylize filter

Explanation:

I took the test on edmentum your welcome.

Answer:

Is B because noisse feltrr✔️

In this lab you are asked to declare two variables of type integer: userNum and x. The user should input should be stored using scanf statements. Then you are asked to divide the value for userNum by x three times(three different operations). Each time you do the division, assign the value to userNum overwriting the previous value and print it out using a print statement. Do this three times. In this case there is only one new line print statement at the end.
#include
int main(void) {
int x;
int userNum;
scanf("%d %d" , &userNum, &x);
userNum = (double)userNum / x;
printf("%d " , userNum);
userNum = (double)userNum / x;
printf("%d " , userNum);
userNum = (double)userNum / (double)x;
printf("%lf\n" , (double)userNum);
return 0;
}
my input is 100 2
my output is 50 25 12.000
8 months ago

Answers

Answer:

See Explanation

Explanation:

Your program is correct and it follows the correct sequence; however, the reason you keep getting integer result is because the question requires that you declare both variables as integer.

The only modification required in your program is to change change #include to #include <stdio.h> for the program to be free of error.

Kim frequently saves her PowerPoint files in a different format. So, she decides to add a command for this action to the Quick Access Toolbar. Complete the steps to follow for this task.

1. Select a drop-down menu at the top of the screen.

2. Choose
from the Customize Quick Access Toolbar list.

3. A Quick Access Toolbar dialog box opens.

4. In the
section, select
.

5. Choose Save As Other Format.

6. Click the
button, and click OK.

Answers

Answer:

More Commands, Choose Commands from, All commands, Add

Explanation:

Correct on Edg

More Commands, Choose Commands from, All commands.

What is Commands?

One form of statement that tells someone what to do is a command. Additional sentence types include inquiries, exclamations, and declarations.

Usually, but not always, command phrases begin with an imperative (bossy) verb because they demand that the subject take an action.

Children should first learn about and be able to recognize the word classes noun, verb, adjective, and adverb before being taught commands. They can start working on instructions and the usage of imperative verbs after they are familiar with these.

Therefore, More Commands, Choose Commands from, All commands.

To learn more about Commands, refer to the link:

https://brainly.com/question/30319932

#SPJ3

In the insert table of figures dialog box which drop down menu do you use to choose what information is displayed in the table

Answers

Answer:

caption label

Explanation:

Which of the following takes place during the research phase

Answers

i would say a formulation of the hypothesis

I am unsure if this is the correct question, but I think this is the full question:

Which of the following takes place during the research phase? (choose all that apply)

O software requirements are gathered

O software requirements are implemented in code

O software requirements are analyzed

O software requirements are detailed in a specification document

The answers to this question are software requirements are gathered, software requirements are analyzed, and software requirements are detailed in a specification document (1st, 3rd, and 4th options).

How computer can affect the life of people?

Answers

Answer These are the negative effectsLow grades In school: others use the computer not for studying but something else. Which makes them unfocused in school.Waist and wrist pains: Due to long sitting ppl experience pains all over the body.

Addiction: People get addicted to the computer and makes them forget they have something important doing.

Consider the GBN protocol with a sender window size of 4 and a sequence number range of 1,024. Suppose that at time t, the next in-order packet that the receiver is expecting has a sequence number of k. Assume that the medium does not reorder messages. Answer the following questions: What are the possible sets of sequence numbers inside the sender’s window at time t? Justify your answer. What are all possible values of the ACK field in all possible messages currently propagating back to the sender at time t? Justify your answer.

Answers

Answer:

Follows are the solution to this question:

Explanation:

In point a:

N = Size of window = 4

Sequence Number Set = 1,024

Case No. 1:

Presume the receiver is k, and all k-1 packets were known. A window for the sender would be within the range of [k, k+N-1] Numbers in order

Case No. 2:

If the sender's window occurs within the set of sequence numbers [k-N, k-1]. The sender's window would be in the context of the sequence numbers [k-N, k-1]. Consequently, its potential sets of sequence numbers within the transmitter window are in the range [k-N: k] at time t.

In point b:

In the area for an acknowledgment (ACK) would be [k-N, k-1], in which the sender sent less ACK to all k-N packets than the n-N-1 ACK. Therefore, in all communications, both possible values of the ACK field currently vary between k-N-1 and k-1.

A user is asked to type a caption for a photo in a web form's text field. If the caption didn't end with a punctuation mark (. ! ?), a period should automatically be added. A common error is to end with a comma, which should be replaced by a period. Another common error is to end with two periods, which should be changed to one period (however, ending with three periods (or more) indicates elipses so should be kept as is). The corrected caption is output. If the input is "I like pie", the output is "I like pie." If the input is "I like pie!", the output remains "I like pie!" If the input is "Coming soon…", the output remains "Coming soon…"

Answers

Answer:

Here is the c++ program:

#include <iostream>  //to use input output functions

using namespace std;  //to identify objects cin cout

int main() {  //start of main function

string caption;  //stores the caption

int last_index;  //stores the index position of the last character of caption

char last_character;  //stores the last character of the caption

cout<<"Please type a caption: ";  //prompts user to enter a caption

getline(cin, caption);  //reads the complete line of caption from user

last_index = caption.size() - 1;  //sets the last_index to the last character of caption

last_character = caption.at(last_index);  //sets the last_character to the last character positioned by last_index

if ((last_character == '!') || (last_character == '?')) {}  /* checks if the last character of the caption is either ! or ? and if this statement evaluate to true then this does not require any action */

else if (last_character == ',') {  //checks if the last character of the caption is a comma

caption.at(last_index) = '.'; }  //if the else if condition is true then replace that comma with a period .

else if (last_character != '.') {  //checks if the caption does not end with ! ? , .

caption.push_back('.');}  //append period to the caption . if above if else condition is true

else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) {  //checks if the caption has two periods .

if ((last_index > 1) && (caption.at(last_index - 2) == '.')) {}  //checks if the caption has three periods and does nothing if this is true

else {  //if caption has two periods

caption.pop_back();}}  //removes one period if caption has two periods .

cout << caption << endl;}  //displays the caption

Explanation:

I will explain the above program with an example

Lets say user input the caption: I like pie

So

caption = " I like pie"

The first if condition if ((last_character == '!') || (last_character == '?')) evaluate to false because the last character of the caption is not an exclamation mark of a question mark. So the program moves to the next else if statement:

else if (last_character == ',') This statement is also false because the last character of the caption is not a comma. So the program moves to the next else if part.

else if (last_character != '.')

Now this statement evaluate to true because the last character of the caption is not a period . sign. So this part is executed. It has a statement:

caption.push_back('.');

Now this statement uses push_back() method which adds new character i.e. period '.' at the end of the caption string, increasing its length by one.

So the output of the program is:

I like pie.

If the caption = " I like pie!" then this if ((last_character == '!') || (last_character == '?')) condition executes and since it does nothing {} so the caption remains as it is and the output is:

I like pie!

If the caption = "Coming soon…" then this else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) condition executes which checks if the caption has two period. When this condition evaluates to true then the statement inside this else if condition executes which is: if ((last_index > 1) && (caption.at(last_index - 2) == '.')) and this checks if the caption has three periods. Yes the caption has three periods so it does nothing and the caption remains as it is and the output is:

Coming soon…

However if the caption is Coming soon.. with two periods then the else part inside else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) condition executes which is: caption.pop_back(); and this removes one period from the caption and the output is:

Coming soon.

The screenshot of the program and its output is attached.

Write both an iterative and recursive solution for the factorial
problem.

Answers

Answer:

Explanation:

Recursive:

C++ program to find factorial of given number  

#include <iostream>  

using namespace std;  

unsigned int factorial(unsigned int n)  

{  

   if (n == 0)  

       return 1;  

   return n * factorial(n - 1);  

}  

 

// Driver code  

int main()  

{  

   int num = 5;  

   cout << "Factorial of "

        << num << " is " << factorial(num) << endl;  

   return 0;

Iterative:

// C++ program for factorial of a number  

#include <iostream>  

using namespace std;  

 

unsigned int factorial(unsigned int n)  

{  

   int res = 1, i;  

   for (i = 2; i <= n; i++)  

       res *= i;  

   return res;  

}  

 

// Driver code  

int main()  

{  

   int num = 5;  

   cout << "Factorial of "

        << num << " is "

        << factorial(num) << endl;  

   return 0;  

}

In Java code, the line that begins with/* and ends with*/ is known as?​​​​​​​​​​​​​​​​​​​

Answers

Answer:

It is known as comment.

After modifying a numbered list in her presentation, Su notices the numbers and the text are too close to each other. She knows she can solve this issue by using the hanging indent marker. Unfortunately, the ruler is not visible in her PowerPoint workspace.

Which tab and command group should she use to access the ruler? (View, Show or Insert, Add-ins or Home, Paragraph)
After selecting the numbered list, in which direction should she drag the hanging indent marker to increase the space between the numbers and the text? (upward or downward or to the left or to the right)

Answers

Answer:

1. View, show

2. to the right

Explanation:

On edg

Answer:

1) View, Show

2) to the right

Explanation:

Why is it important for element IDs to have meaningful names?

Answers

Answer:

Explanation:

In programming, it is very important that element ID's have meaningful names because it allows anyone reading the code to be able to easily identify what that element is and where it is most likely to be found in the code. This also applies to variables in every programming language. The clearer and more unique the name is the easier it becomes to know what that variable or element ID is representing which ultimately makes reading and debugging the code that much easier. This means that the entire process becomes more efficient as well.

It is vital for element IDs to have meaningful names due to the fact that it allows easy identification of the codes.

Element IDs refer to the id property of the interface of the element. It should be noted that the id property is unique in a document.

Element IDs should have meaningful names due to the fact that it allows east identification of the codes. This makes it easy for the person reading the code to identify them easily. The uniqueness of an element ID is vital to know what it represents.

Read related link on:

https://brainly.com/question/18173585

Shana works for a company that makes industrial kitchen equipment that is sold to cafeterias and restaurants. She helps the company’s sales representatives create presentations for clients. They regularly use a custom PowerPoint template to craft their pitches. The sales reps have asked for a slide that will allow them to add a diagram showing the benefits of the equipment they sell.

What steps should Shana take to meet the needs of the company’s sales representatives?

Insert a slide for a diagram each time a sales rep needs to create a new presentation.
In the template’s Slide Master tab, use Master Layout to pick a placeholder for a diagram.
In the template’s Slide Master tab, select Insert Layout, name the layout, and insert a placeholder.
Save a brand-new presentation using the template, select Insert, and choose Charts from the Illustrations command group.

Answers

Answer:

Its C on edg

Explanation:

100%

Answer:

c

Explanation:

P5.30 Having a secure password is a very important practice, when much of our information is stored online. Write a program that validates a new password, following these rules: •The password must be at least 8 characters long. •The password must have at least one uppercase and one lowercase letter. •The password must have at least one digit. Write a program that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. Your program should include a function that checks whether a password is valid.

Answers

Answer:

def check_password(password):

   is_short = False

   has_uppercase = False

   has_lowercase = False

   has_digit = False

   

   if len(password) < 8:

       is_short = True

   

   for p in password:

       if p.isupper():

           has_uppercase = True

       if p.islower():

           has_lowercase = True

       if p.isdigit():

           has_digit = True

   

   if is_short == False and has_uppercase and has_uppercase and has_digit:

       return True

   else:

       return False

while True:

   password = input("Enter your password: ")

   password2 = input("Enter your password again: ")

   

   if password == password2 and check_password(password):

       break

Explanation:

Create a function named check_password that takes one parameter, password

Inside the function:

Initialize the is_short, has_uppercase, has_lowercase, and has_digit as False. These variables will be used to check each situation

Check the length of the password using len() method. If it is smaller than 8, set is_short as True

Create a for loop that iterates through password. Check each character. If a character is uppercase, set the has_uppercase as True (use isupper() function). If a character is lowercase, set the has_lowercase as True (use islower() function). If a character is a digit, set the has_digit as True (use isdigit() function).

When the loop is done, check the value of is_short, has_uppercase, has_lowercase, and has_digit. If is_short is False and other values are True, return True. Otherwise, return False

Create an indefinite while loop, that asks the user to enter password twice. Check the entered passwords. If they are equal and the check_password function returns True, stop the loop. This implies that both passwords are same and password is valid.

Which IEEE standards define Wi-Fi technology?

network standards

802.11 standards

111.82 standards

fidelity standards

Answers

Answer:

802.11 standards

the answer is:

b. 802.11 standards

in a blank excel workbook go to insert tab on the ribbon, which of the following is Not vailable 1 smart art 2 coloumns ( not coloumn chart) 3 shapes 4 pictures​

Answers

Answer:

hahahahahahahhahah

The rows that are not available in a blank excel workbook go to the insert tab on the ribbon.  The correct option is D.

What are ribbons?

Click the Ribbon Display Options icon in the document's upper right corner. The Minimize icon is to the left of it. To display the Ribbon with all tabs and all commands, select Show Tabs and Commands from the menu that appears.

Basic units known as cells are created by rows and columns in an Excel workbook. There are only a set number of rows and columns available for the workspace.

There are 1,048,576 rows in the workbook's excel worksheet. It cannot be inserted using the Insert tab on the ribbon. Images, tables, and shapes can be added by selecting the tab or option for the Insert tab.

Therefore, the correct option is D, Rows.

To learn more about rows, refer to the link:

https://brainly.com/question/29889229

#SPJ2

The question is incomplete. Your most probably complete question is given below:

Pictures

Table

Shapes

Rows

If you are wanting to change programs, when do you need to make this request?
a.To change programs, you must contact your advisor or counselor and complete the change of program application during an open application window.
b.You can change at any time; just email your advisor regarding the change.
c.You can never change programs.
d.You do not need to notify anyone. You just need to start taking courses for the desired program.

Answers

Answer:

If your discussing colleges and degrees, you cant take courses your not autorized to take.

So if you have one major and wish to change to another then you need to discuss with a student advisor or counseler so they can make the changes. They will also discuss which classes are necessary for your program of choosing, making sure all your requirements are completed.

Explanation:

You are allowed to use up to 5 images from one artist or photographer without
violating Copyright laws

Answers

If it’s a true or false question, then I think it’s false because I’m pretty sure you have to give credit.

Bluetooth's pan are also known as______.​

Answers

Answer:

personal area network..??

Explanation:

RAM
Clear sel
19. Which computer memory is used for storing programs and data
currently being processed by the CPU?
Mass memory
RAM
O Neo-volatile memory

Answers

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct answer is RAM.

RAM is used for storing programs and data currently being processed by the CPU.  So, the data in the RAM, can be easily accessible and processed by the CPU more fastly.

While Mass memory and neo volatile memory is not correct options. because these types of memory can stores a large amount of data but CPU fetch data from these memories into RAM. and, RAM can only be used by the CPU when performing operations.

Please help I upped the points and please don't answer if you don't have the answer..

3. Describe two of your long-term financial goals, and explain why these goals are important to you. List three steps that might help you accomplish this goal. (4-6 sentences. 2.0 points)

4. Describe and example of common financial resource, and example, and a debt. These can be examples from your own life or from other people you know or can imagine. (3-6 sentences. 3.0 points)

Answers

Answer:

3. Paying for my daughter to attend college and building a life outside of struggle. These goals must be accomplished by me finishing school, going onto college and maybe even starting my own business. I must set an appropriate example for my daughter to learn from someone who she believes in. Starting a family business to pass down to generations will be an excellent way to start financially planning now ahead of time.

4. Living in a family of mines, common financial resource is either government assisted or public security.An expense that I cannot escape now is the caring for of my daughter which will vary as she get older. Lastly a debt would be the over spending of credit cards with no money to pay it back as the interest rates climb.

Explanation:

Passivity can harm relationships because those who are passive
a. Have open relationships with others
b. Tend to store up hurt feelings, leading to resentment
C. Typically have excessive self-esteem
d. Are free from self doubt and worry

Answers

Answer:

B. Tend to store up hurt feelings, leading to resentment

Explanation:

May I have brainliest please? :)

Passivity can injure relationships because those who are passive that can tend to store up hurt impressions, leading to resentment.

What is the Passivity?

passiveness or Passivity is defined as Only the feeling of repository visitors that pass before his paintings get down me more than this charlatan, and they may have a hunch that they are being duped, but they are unable to accept the information of their eyes.

Passivity can ruin relationships because passive people prefer to hold on to upset sentiments, which can develop to resentment.

Therefore, option b is correct.

Learn more about the Passivity, refer to:

https://brainly.com/question/20924905

#SPJ2

The CPU is located on what part of the computer?

the motherboard

the system bus

the random access memory

the hard drive

Answers

Answer:

the motherboard

Explanation:

The answer for this question is the first one.

What is the name of the file in which this
program is stored: public class myProgram
A. myProgram.class
B. myProgram.java
C. myProgram.jgrasp
D. myProgram.doc

Answers

Answer:

B

Explanation:

i’m an information technology  student and as I remember we used this  name

Which tool did Adnan use to modify the image?

rotation handle
left sizing handle
top sizing handle
corner sizing handle

Answers

Answer:

D

Explanation:

Answer:

corner sizing handle

Explanation:

The email application used by Jim’s office is sending emails with viruses attached to them to user’s computers. What step should Jim try first to resolve the issue?
A. Downgrade the email software to an older, previous version
B. Buy a newer email program and migrate the office computers to that program
C. Switch from open source software to proprietary software
D. Check for and install patches or software updates

Answers

Answer:

A

Explanation:

What is the appropriate guidelines to create and manage files

Answers

Answer:

1. Do not copyright

2. Nothing illegal

3.Do not put personal info

Explanation:

Other Questions
Objectivism is the view that: Blossom Corporation had income from continuing operations of $10,895,300 in 2020. During 2020, it disposed of its restaurant division at an after-tax loss of $194,400. Prior to disposal, the division operated at a loss of $321,800 (net of tax) in 2020 (assume that the disposal of the restaurant division meets the criteria for recognition as a discontinued operation). Blossom had 10,000,000 shares of common stock outstanding during 2020. Prepare a partial income statement for Blossom beginning with income from continuing operations. (Round earnings per share to 2 decimal places, eg. 1.48.) BLOSSOM CORPORATION Income Statement (Partial) $ HELP PLEASE!!!Which action did John Muir take that brought about "green awareness"?A. He identified the connection between pesticides and cancer.O B. He created the Environmental Protection Agency.C. He wrote wildlife and survival guides for nature enthusiasts.O D. He founded the Sierra Club.SUBMIT The sum of 2x and 3y is less than 16 What is the blending theory of inheritance? Why did Mendel question this theory? 11=r/13 solve and write division equitation please reply fast.............. at a sport camp, there are sufficient food for 72 athletics to last 6 days. if 18 athletics are absent from the camp, how many more days can the food last for the other athletics? state the assumption made. The skeletal structure in line-angle (line-bond) mode of 2,3,3,5-tetramethylhexane is shown. Identify the number of hydrogen atoms bound to each carbon atom in the structure. What must we do to attain the common good? Which change should she make in her outline?Change Step 2 to Click the Format tab.Change Step 3 to Open the Chart Title dialog box.Change Step 4 to Type in the chart title.Change Step 5 to Add the Chart Title. A ______ is formed by a group of people who become its members and deposit their money with the institution. They can take loans from the institutions available funds. How would you justify using cloud computing?A less network trafficB sharing a network could reduce overall costsC new technologyD government pressure Help Complete each sentence with the correct form of the -ar verb in parentheses hurrywrite a 600 word story about your vacation to hawaii Who is the experienced expert in software design and delivery? 2. Read the following sentences carefully. The order of adjectives in each sentence is incorrectCorrect the order of adjectives and rewrite the sentences carefully in your notebooksa Sara is wearing a blue, nice dress for the party tonight A statistics teacher was interested in the relationship between the number of days students waited to start a project and the score that project received (out of 100 points). Information was collected on several students and was used to obtain the regression equation y = 3.64x + 96.5, where x represents the number of procrastination days and y is the predicted grade. What is the predicted grade of a student who procrastinated for 2 days?25.9685.5889.22103.78 dice is rolled 3000 timeshow many times would you expect to roll a 5 There is more Biodiversity in the costal plains ecoregion than in the mountains basin ecoregion due to:A. More annual precipitation B. Higher elevationC. Less annual precipitation D. Colder temperatures