(C PROGRAMMING ONLY) Do not edit the main() code. 5. My Sincere Apologies by CodeChum Admin Okay, I don't know what got into me but that was childish! Spamming someone is immature and does not show good ethics. Never do it unless it's an emergency.   I should apologize to my friend, Lionel huhu! Would you help me? I already know how to structure the flow of my message, just please help me define it properly.   Instructions: In the code editor, you are provided with a main() code with multiple calls to a function which is already declared but not yet defined called, sendApology(). Your task is to define the sendApology() function with the following details: Return type - void Function name - sendApology Parameters - a character and an integer. The sendApology() function will first check if the character passed is either 's', 'o', 'r', or 'y'. If it is, print it based on the passed integer number of times. For example, if the passed integer is 5, then you need to print the character 5 times. Otherwise, just ignore it (i.e. don't do anything). Do not edit the main() code.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question

(C PROGRAMMING ONLY)

Do not edit the main() code.

5. My Sincere Apologies
by CodeChum Admin

Okay, I don't know what got into me but that was childish! Spamming someone is immature and does not show good ethics. Never do it unless it's an emergency.

 

I should apologize to my friend, Lionel huhu! Would you help me? I already know how to structure the flow of my message, just please help me define it properly.

 

Instructions:

In the code editor, you are provided with a main() code with multiple calls to a function which is already declared but not yet defined called, sendApology().
Your task is to define the sendApology() function with the following details:
Return type - void
Function name - sendApology
Parameters - a character and an integer.
The sendApology() function will first check if the character passed is either 's', 'o', 'r', or 'y'. If it is, print it based on the passed integer number of times. For example, if the passed integer is 5, then you need to print the character 5 times. Otherwise, just ignore it (i.e. don't do anything).
Do not edit the main() code.


Output

sooorrrrrrrrryyyyy

is either 's', 'o', 'r', or 'y'. If it is,
main.c
+
print it based on the passed
integer number of times. For
1
#include<stdio.h>
example, if the passed integer is
3
void sendApology(char, int);
5, then you need to print the
4
character 5 times. Otherwise, just
5- int main(void) {
sendApology('s', 2);
sendApology('f', 10);
sendApology('b', 3);
sendApology('o', 5);
sendApology('r', 12);
sendApology('m', 5);
sendApology('v', 2);
sendApology('y', 7);
ignore it (i.e. don't do anything).
4. Do not edit the main() code.
7
9.
10
Output
11
12
13
14
sooorrrrrrrrryyyyy
15
return 0;
16 }
17
void sendApology(char letter, int n) {
// TODO: Implement the function definition
18
19
Transcribed Image Text:is either 's', 'o', 'r', or 'y'. If it is, main.c + print it based on the passed integer number of times. For 1 #include<stdio.h> example, if the passed integer is 3 void sendApology(char, int); 5, then you need to print the 4 character 5 times. Otherwise, just 5- int main(void) { sendApology('s', 2); sendApology('f', 10); sendApology('b', 3); sendApology('o', 5); sendApology('r', 12); sendApology('m', 5); sendApology('v', 2); sendApology('y', 7); ignore it (i.e. don't do anything). 4. Do not edit the main() code. 7 9. 10 Output 11 12 13 14 sooorrrrrrrrryyyyy 15 return 0; 16 } 17 void sendApology(char letter, int n) { // TODO: Implement the function definition 18 19
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,