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]
4 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]4 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
Question #4
Igoryamba

Answer:

The y-intercept is going to fall by -2 but the x-intercept will run +5

Explanation:

Becuase the derivative of the equation causes this when plugged into the formula

6 0
3 years ago
When working in the navigation pane, you ____ a folder to open it?
SpyIntel [72]
When working in the navigation pane, you click a folder to open it
3 0
3 years ago
เเปลภาษานิราศภูเขาทอง
Marianna [84]
Type it up in English
4 0
3 years ago
John is a mechanical engineer. His first task at his job is to build any microphone of his choice. He chooses to build a dynamic
Jobisdone [24]

Answer:

A. simple to construct and easy to repair

Explanation:

A dynamic microphone works on the principle of electromagnetic principle. A diaphragm is attached to a coil of wire which helps in producing sound. Responding to the sound waves, the coil of the wire is vibrated by the diaphragm.  A magnetic field is created by the magnet which is present inside the coil of wire. The electrical signal is generated in response to the motion of the coil. The speed of the motion produces the amount of the current.

Since the construction of a dynamic microphone is easier as compared to any other microphone, John is likely to opt to build one.

7 0
3 years ago
________ employs state-of-the-art computer software and hardware to help people work better together.
qaws [65]

Answer:not enough information

Explanation:

6 0
3 years ago
Other questions:
  • Define a model or version that is used to test an idea is called a _______.
    7·1 answer
  • Which is true about routers and switches?
    5·1 answer
  • Connie decided that her paper should be organized in the order in which the events happened. What type of organizational method
    15·1 answer
  • In what year was google launched on the web?
    14·1 answer
  • 9
    10·1 answer
  • Juan has performed a search on his inbox and would like to ensure the results only include those items with attachments which co
    14·2 answers
  • Your company is getting negative feedback on the current customer service process. It’s your job to make sure customers are happ
    10·1 answer
  • Identify the reasons that numeric data representation is important to computer programmers. Check all that apply.
    12·2 answers
  • Create a set of functions that compute the mean, median, and mode of a set of
    8·2 answers
  • How do i copy a canvas course from old class to new course.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!