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
PolarNik [594]
4 years ago
8

Write a function with this prototype:

Computers and Technology
1 answer:
sp2606 [1]4 years ago
5 0

Answer:

Following are the code to this question:

#include <iostream> //defining header file  

using namespace std;

void numbers(ostream &outs, const string& prefix, unsigned int levels); // method declaration

void numbers(ostream &outs, const string& prefix, unsigned int levels) //defining method number

{

string s; //defining string variable

if(levels == 0) //defining condition statement that check levels value is equal to 0

{

outs << prefix << endl;  //use value

}

else //define else part

{

for(char c = '1'; c <= '9'; c++) //define loop that calls numbers method

{

s = prefix + c + '.'; // holding value in s variable  

numbers(outs, s, levels-1); //call method numbers

}

}

}

int main() //defining main method

{

numbers(cout, "THERBLIG", 2); //call method numbers method that accepts value

return 0;

}

Output:

please find the attachment.

Explanation:

Program description:

  • In the given program, a method number is declared, that accepts three arguments in its parameter that are "outs, prefix, levels", and all the variable uses the address operator to hold its value.
  • Inside the method a conditional statement is used in which string variable s and a conditional statement is used, in if the block it checks level variable value is equal to 0. if it is false it will go to else block that uses the loop to call method.
  • In the main method we call the number method and pass the value in its parameter.  

You might be interested in
Which of the following is NOT true about Parvati's web search? Group of answer choices a) She will enter the desired search text
shepuryov [24]

Answer:

The answer is letter A

Explanation:

<em>She will enter the desired search text in the query box. This statement is NOT TRUE</em>

3 0
3 years ago
An integrated file is one that includes information created in _____ Office application(s).
maria [59]

The integration of the document and records management in the organizations allows the satisfactory organization of the information, reducing the physical file and the costs while increasing the efficiency of all the business processes.

6 0
3 years ago
An _______ takes place when an unauthorized person gains access to a digital device by using an Internet connection and exploiti
elena55 [62]

A Online Intrusion takes place when an unauthorized person gains access to a digital device by using an internet connection and exploiting vulnerabilities in hardware or software

4 0
3 years ago
While creating a web page, what does each of the following HTML tags define?
STatiana [176]

Answer:

Paragraph is <p> and </p>

Term is <de> and </did>

Single line break is only <br>

A heading is <h1> to <h8> to </h1> and </h8>

4 0
4 years ago
Write a method, getSecondLine, that is passed a String argument and that returns the second line, without its newline character.
laiz [17]

Answer:

The answer to this question can be given as:

Method definition :

String getSecondLine (String aString) //define function getSecondLine()

{

return aString.substring(aString.indexOf("\n") + 1, aString.indexOf("\n") + 1 + aString.substring(aString.indexOf("\n") + 1, aString.length()).indexOf("\n"));

//return value.

}

Explanation:

The working of the function definition can be given as:

In the above function definition we define getSecondLine() function.

This function returns string value because we use the string return type.

In this getSecondLine() function we pass the a string variable that use substring function which return a string into parts.

In the substring function we use the indexOf function that is used to return the position of the string.

In this method definition, it will return the string value into the new lines.

6 0
4 years ago
Other questions:
  • . What is an APT? What are some practical strategies to protect yourself from an APT?
    7·1 answer
  • A moldboard was a feature and technological development of what device
    11·1 answer
  • What is the most important reason to create a backup of your files somewhere other than your computer
    6·1 answer
  • Write a recursive program that requests an answer to the question "Are we there yet?" using an input statement and terminates if
    10·1 answer
  • _______ tools enable people to connect and exchange ideas.
    7·2 answers
  • Write a program that accepts a file name from the command line, then initializes an array with test data using that text file as
    6·1 answer
  • Nominal data: are ranked according to some relationship to one another. have constant differences between observations. are sort
    12·1 answer
  • Which of the following should you press to insert a non-
    8·2 answers
  • Which of the following is true of lossy and lossless compression techniques?
    13·1 answer
  • What year was html released?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!