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]
3 years ago
8

Write a function with this prototype:

Computers and Technology
1 answer:
sp2606 [1]3 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
NWhen you measure a person’s weight, you are measuring the
MAVERICK [17]

Answer:

gravitational force acting on that person.

Explanation:

5 0
3 years ago
Read 2 more answers
What is the meaning of Re:?
adelina 88 [10]

Answer:

In Email's Subject Line “Re:” most commonly understood as “Reply/Response” to an Email. “Re: ” is not taken as abbreviation of Regards/Reference. For Reference, Abbreviation is “Ref.”Explanation:

5 0
3 years ago
Read 2 more answers
When you make a cell phone call, which type of electromagnetic wave is most likely transmitting the signal?
Olegator [25]
They use Radio waves 
6 0
3 years ago
The ________ simulates your work area.
xz_007 [3.2K]
I believe it is, A. taskbar
5 0
3 years ago
Help me pleaseeee!
kenny6666 [7]

Answer:

Try checking around on the router!

Explanation:

Assuming they haven't changed it, most routers have their default password displayed somewhere on it. I hope this helps!! ^^

5 0
2 years ago
Read 2 more answers
Other questions:
  • Write a Console Java program that asks the user to enter one sentence on the keyboard. Output on the console:
    6·1 answer
  • Excel assigns the name ____ to the first excel table created in a workbook.
    10·1 answer
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • NOTE: in mathematics, division by zero is undefined. So, in C , division by zero is always an error. Given a int variable named
    10·1 answer
  • Software that protects confidentiality by screening outgoing documents to identify and block transmission of sensitive informati
    12·1 answer
  • Voice authentication requires speech to text capability Facial recognition may be used for authentication The human iris is uniq
    6·1 answer
  • Seeing an error message on the screen after you click on a link or icon may indicate that your PC doesn't have the correct _____
    15·1 answer
  • Implement the function printTwoLargest that inputs an arbitrary number of positive numbers from the user. The input of numbers s
    14·1 answer
  • What does XD mean? I keep seeing people say it and I dont know what it means
    6·2 answers
  • What are some other possible causes of an overheating laptop
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!