1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
andriy [413]
3 years ago
8

6.10.1: Modify a C string parameter. 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!"
Computers and Technology
1 answer:
Andrej [43]3 years ago
6 0

Answer:

#include <iostream>

#include <cstring>

using namespace std;

void replacePeriod(char* phrase) {

int i = 0;

while(*(phrase + i) != '\0')

{

if(*(phrase + i) == '.')

*(phrase + i) = '!';

i++;

}

}

int main() {

const int STRING_SIZE = 50;

char sentence[STRING_SIZE];

strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");

replacePeriod(sentence);

cout << "Updated sentence: " << endl;

cout << sentence << endl;

return 0;

}

Explanation:

  • Create a function called replacePeriod that takes a pointer of type char as a parameter.
  • Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
  • Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
  • Finally display the updated sentence.
You might be interested in
ZipCar uses cutting edge wireless technology combined with sophisticated data management and security techniques to assure that
Bingel [31]

Answer:

dependable

Explanation:

3 0
1 year ago
Which statements describe the use of styles in Word? Check all that apply.
algol [13]

Answer:

can be used to make word docments look the same

Explanation:

4 0
3 years ago
Read 2 more answers
What's exactly the difference between "Library" and "Framework" ? ​
Mariana [72]
Answer:

The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in control. But with a framework, the control is inverted:the framework calls you

Explanation:

A library performs specific, well-defined operations.

A framework is a skeleton where the application defines the "meat" of the operation by filling out the skeleton. The skeleton still has code to link up the parts but the most important work is done by the application.

Examples of libraries: Network protocols, compression, image manipulation, string utilities, regular expression evaluation, math. Operations are self-contained.

Examples of frameworks: Web application system, Plug-in manager, GUI system. The framework defines the concept but the application defines the fundamental functionality that end-users care about.
8 0
2 years ago
Ken is a table busser at a restaurant. Ken's boss has requested that instead of waiting to be told what tables need to be cleane
Vsevolod [243]
Ken can improve his initiative
5 0
3 years ago
Read 2 more answers
Double[][] vals =
Vilka [71]

Answer:

4

Explanation:

by counting the number of the colum to. be counted well and nicely

8 0
2 years ago
Other questions:
  • You are troubleshooting a network issue on a client computer and discover that the network card has an IP address of 169.254.196
    6·1 answer
  • What type of restrictions may be placed on your license?
    7·1 answer
  • 50 Points! 25 Points Each! Please help ASAP! Will mark brainliest! See attached image.
    10·2 answers
  • Which principle of animation deals with imparting a unique identity to the animated character?
    5·1 answer
  • What is logical memory?
    15·1 answer
  • Create a program that will read in a Salesperson name, employment status (1=Full-time AND 2=Part-time) and the sales amount.
    5·1 answer
  • Compared to a virtual image, a real image
    15·2 answers
  • Which of the following tools enables a production mixer to sync audio and video?
    7·1 answer
  • What is the difference between MySQL and MariaDB?
    9·1 answer
  • _______ is a medium-range wireless network. ________ is a medium-range wireless network. Cellular radio LTE UWB Wi-Fi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!