Question: C + + : Write a recursive function named printLine ( ) which receives a character and an int parameters. If the int parameter is
C: Write a recursive function named printLine which receives a character and
an int parameters. If the int parameter is positive, the function prints the character
repeatedly to form a line of the given number of character; otherwise the function does
nothing. The function does not return a value. Thus, if the printLine is called, asterisks will be printed. The function MUST NOT use a loop of any kindor an array to accomplish its job. Instead, it gets the job done by recursively calling
itself. You can test printLine first using the following example:
Example run:
Which character should i display? #
How many should i display?
#####
Then write a recursive function printBlock that uses printLine to print m lines of n characters each. For example, printBlock produces the character, in lines, each has of the character.
Example run:
Which characters should i display?
how manyline?
how many character in each line?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
