5. My Sincere Apologies (C PROGRAMMING ONLY) 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...


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

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

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here