Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ please, only q 1 1. Write a program that prints n copies of character x using function repeatchar() as follows: . If r or

image text in transcribed

c++ please, only q 1

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 is specified, prints 50 copies of character a. If both x and n are specified, prints n copies of character I. 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; A function prototype / int main(void) repeatchar(); repeatchar('='); repeatchar('+', 65); return 0; /* function definition / The output of your program will be: HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH+++ 2. Modify the previous program to use a single function with default arguments, the output of the program should not change

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions