I need some help to program (execute) thefollowing three question: Q1 ; Create a
ID: 3614583 • Letter: I
Question
I need some help to program (execute) thefollowing three question: Q1; Create a function repchar() that has two defaultarguments. The header in the function definition shouldlook like:void repchar(char ch, int n) The function should display the character in ch,n number of times. Use '*' as the default argumentfor ch and 45 as the default argument forn. Demonstrate that repchar works by calling it threetimes in main() with: no arguments
'&' as the single argument
'%' and 30 as the arguments
Q2: Create threedefinitions for an overloaded functionrepchar(). Demonstrate that the functions work byhaving a main() which consists of the followingcalls: voidmain() { repchar(); // displays 45 '*' on the screen repchar('='); // displays45 '=' on the screen repchar('+',30); // displays 30 '+' onthe screen } Each function call will call a differentoverloaded function.
Q3: Create a functioncalled Count() that keeps track of how many times it hasbeen called. Each time it is called, it should display a linesimilar to:
This is call Number5
Demonstrate that it works by setting up a loop inmain() that will call it five times. Do not usereference variables. I need some help to program (execute) thefollowing three question: Q1; Create a function repchar() that has two defaultarguments. The header in the function definition shouldlook like:
void repchar(char ch, int n) The function should display the character in ch,n number of times. Use '*' as the default argumentfor ch and 45 as the default argument forn. Demonstrate that repchar works by calling it threetimes in main() with: no arguments
'&' as the single argument
'%' and 30 as the arguments
Q2: Create threedefinitions for an overloaded functionrepchar(). Demonstrate that the functions work byhaving a main() which consists of the followingcalls: voidmain() { repchar(); // displays 45 '*' on the screen repchar(); // displays 45 '*' on the screen repchar('='); // displays45 '=' on the screen repchar('+',30); // displays 30 '+' onthe screen repchar('+',30); // displays 30 '+' onthe screen } Each function call will call a differentoverloaded function.
Q3: Create a functioncalled Count() that keeps track of how many times it hasbeen called. Each time it is called, it should display a linesimilar to:
This is call Number5
Demonstrate that it works by setting up a loop inmain() that will call it five times. Do not usereference variables.
Explanation / Answer
please rate - thanks question 1 #include using namespace std; void repchar(char ='*',int =45); int main() {int i; repchar(); // displays45 '*' on the screen repchar('&'); // displays 45 '=' onthe screen repchar('+%',30); // displays 30 '+' on the screen system("pause"); } void repchar(char j,int num) {int i; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.