C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

C++

Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley. Nice to meet you." becomes:
"Hello! I'm Miley! Nice to meet you!"
406554.2871636.qx3zqy7
1 #include <iostream>
2 #include <cstring>
3 using namespace std;
4
5 void MakeSentenceExcited (char* sentenceText) {
6
/* Your solution goes here */
8
9}
10
11 int main() {
12
13
14
15 cin.getline (testStr, TEST_STR_SIZE);
16 MakeSentenceExcited (testStr);
17 cout << testStr << endl;
Run
const int TEST_STR_SIZE = 50;
char testStr [TEST_STR_SIZE];
Transcribed Image Text:Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley. Nice to meet you." becomes: "Hello! I'm Miley! Nice to meet you!" 406554.2871636.qx3zqy7 1 #include <iostream> 2 #include <cstring> 3 using namespace std; 4 5 void MakeSentenceExcited (char* sentenceText) { 6 /* Your solution goes here */ 8 9} 10 11 int main() { 12 13 14 15 cin.getline (testStr, TEST_STR_SIZE); 16 MakeSentenceExcited (testStr); 17 cout << testStr << endl; Run const int TEST_STR_SIZE = 50; char testStr [TEST_STR_SIZE];
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning