subject

Write a function with this prototype:
#include
void numbers(ostream& outs, const string& prefix, unsigned int levels);
The function prints output to the ostream outs. The output consists of the String prefix followed by "section numbers" of the form 1.1., 1.2., 1.3., and so on. The levels argument determines how many levels the section numbers have. For example, if levels is 2, then the section numbers have the form x. y. If levels is 3, then section numbers have the form x. y.z. The digits permitted in each level are always '1' through '9'. As an example, if prefix is the string "THERBLIG" and levels is 2, then the function would start by printing:
THERBLIG1.1.THERBLIG1.2.THERBLIG1.3 .and ends by printing:THERBLIG9.7.THERBLIG9.8.TH ERBLIG9.9.The stopping case occurs when levels reaches zero (in which case the prefix is printed once by itself followed by nothing else).The string class from has many manipulation functions, but you'll need only the ability to make a new string which consists of prefix followed by another character (such as '1') and a period ('.'). If s is the string that you want to create and c is the digit character (such as '1'), then the following statement will correctly form s:s = (prefix + c) + '.';This new string s can be passed as a parameter to recursive calls of the function.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:30
Write a program that reads the file, then displays the average number of steps taken for each month. (the data is from a year that was not a leap year, so february has 28 days.) your program needs to use at least 3 functions not counting main and display the information in a neat well formatted fashion.
Answers: 3
question
Computers and Technology, 22.06.2019 22:50
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
You know the right answer?
Write a function with this prototype:
#include
void numbers(ostream& outs, const st...
Questions
question
History, 03.09.2021 17:50
question
Mathematics, 03.09.2021 17:50
question
Physics, 03.09.2021 17:50
question
Social Studies, 03.09.2021 17:50
question
Spanish, 03.09.2021 17:50
Questions on the website: 13722359