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
Credible sites contain __________ information,
Reptile [31]

Answer:

All of the above. Explanation:Credible sites include the date of any information, cite the source of the information presented, are well designed and professional.

6 0
3 years ago
Read 2 more answers
Ted is a fashion designer. Where is he most likely to work
vredina [299]
Ted is most likely to work in New York or France
6 0
3 years ago
WHAT 1 + 1 ???? ???????????????????
antiseptic1488 [7]
The answer to this is 11
5 0
3 years ago
Read 2 more answers
Which is NOT something that a game producer needs to do?
3241004551 [841]

Answer:

Plan the script, characters, and how the game is played

6 0
3 years ago
Which decimal number is equivalent to the hexadecimal number F1?
Papessa [141]

Answer:

C

Explanation:

8 0
3 years ago
Other questions:
  • A type of memory that is expensive and therefore is often used only in cache memory applications.
    15·2 answers
  • How does technology improve convenience, but impact our privacy?
    8·1 answer
  • How to get the absolute value in coding begginners?
    13·2 answers
  • _____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
    7·1 answer
  • What are the correct answers?
    11·1 answer
  • Suppose a family has had a house fire in which
    7·2 answers
  • How to make a harmonic mean algorithm in bash Linux?
    15·1 answer
  • Add Try/Catch error checking To make sure that the user enters valid values in your program. To catch negative values passed to
    9·1 answer
  • One rule in the Java programming language is that you have to place a semicolon at the end of each statement. What is this rule
    10·2 answers
  • The best way to deal with crying children in the car is to ignore them or pull off the road
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!