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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:20, gracie0818
Q-3 a technician is setting up a computer lab. computers on the same subnet need to communicate with eachother peer to peer communication, a. hardware firewallb. proxy serverc. software firewalld. gre tunneling
Answers: 3
image
Computers and Technology, 23.06.2019 07:30, Morganwing1019
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
image
Computers and Technology, 23.06.2019 11:00, swelch2010
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, anamatiascamaja
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
You know the right answer?
Write a function with this prototype:
#include
void numbers(ostream& outs, const st...

Questions in other subjects:

Konu
Biology, 14.11.2020 06:00
Konu
Mathematics, 14.11.2020 06:00