Question: Question 2 in C++ please 1. Write a program that prints n copies of character x using function repeatchar() as follows: If r or n

Question 2 in C++ please Question 2 in C++ please 1. Write a program that prints ncopies of character x using function repeatchar() as follows: If r or

1. Write a program that prints n copies of character x using function repeatchar() as follows: If r or n are not specified, prints 50 copies of the character asterisk *. If only x is specified, prints 50 copies of character x. If both x and n are specified, prints n copies of character r. Write the three versions of the repeatchar() function in the following program: File: repeatcharoverload.cpp This program uses a number of different functions to print multiple copies of a character Programmer: your name Date: #include using namespace std; /* function prototype */ int main(void) repeatchar (; repeatchar('='); repeatchar ('+', 65); return 0; /* function definition */ The output of your program will be: ************************************************** HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH 2. Modify the previous program to use a single function with default arguments, the output of the program should not change. /* File: repeatchardefaultargs.cpp Ti l faut ab dafal Amitato HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH 2. Modify the previous program to use a single function with default arguments, the output of the program should not change. * File: repeatchardefaultargs.cpp This program uses a single function with default arguments to print multiple copies of a character Programmer: your name Date: */ #include using namespace std; /* function prototype */ int main(void) repeatchar(); Assignment # 2 repeatchar ('='); repeatchar('+', 65); return 0; /* function definition */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!