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
Which statement opens a text file so that you can retrieve the information it contains?
vesna_86 [32]

Answer:

Answered below

Explanation:

aFile = open("books.txt", "r")

This code uses the function open() which takes two parameters. The first parameter is the file name while the second parameter is the mode in which you are accessing the file.

The "r" mode opens the file in a reading state. That is, you can only read from the file. This code completes the reading process

aFile.read( )

The "w" mode opens the file so you can write to it and make changes.

The "a" mode opens the file so you can add contents to it.

3 0
2 years ago
A thin film transistor (TFT) is a/an______________.
Leviafan [203]

Answer:

Option a electronic switch used on FPDs

Explanation:

A thin film transistor (TFT) is an electronic switch which is commonly used in a liquid crystal display (LCD). TFT derives its name by the way how it is produced. It is produced by layering thin films of semiconductor.  TFT is a type of transistor which is used to control state every  individual pixel in a LCD. TCT can change the states of pixels (on and off) very quickly.

6 0
3 years ago
3. Write a program that prompts the user to input an integer that represents cents. The program will then calculate the smallest
miss Akunina [59]

Answer:

The program in Python is as follows:

cents = int(input("Cents: "))

qtr = int(cents/25)

cents = cents -qtr * 25

nkl = int(cents/5)

pny = cents -nkl * 5

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

Explanation:

This gets input for cents

cents = int(input("Cents: "))

This calculates the quarters in cents

qtr = int(cents/25)

This gets the remaining cents

cents = cents -qtr * 25

This calculates the nickel in remaining cents

nkl = int(cents/5)

This calculates the pennies in remaining cents

pny = cents -nkl * 5

This prints the required output

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

6 0
2 years ago
What does PRAM stand for?
Nana76 [90]
<span>PRAM- Phase-Change Random Access Memory</span>
7 0
3 years ago
Read 2 more answers
3. For “Incident Energy Analysis” What body parts are involved in the distance
krek1111 [17]

The body part that is close to the arc flash boundary is the energized conductors or circuit parts.

<h3>What is the distance of an arc flash?</h3>

The working distance is known to be the distance that exist between a person and the center of an arc flash.

Note that The body part that is close to the arc flash boundary is the energized conductors or circuit parts.

Learn more about Energy from

brainly.com/question/13881533

#SPJ1

7 0
1 year ago
Other questions:
  • Alkane is a Variety of which fruit
    6·1 answer
  • In this question, you must create a function in C++ using an external editor. When satisfied with your work, you shall attach it
    10·1 answer
  • Effective presentations vary the color scheme on each slide.<br><br> True<br> False
    5·2 answers
  • Andy wants to install a new Internet connection. He wants to take the fastest he can get. What are the maximum speeds for the fo
    9·1 answer
  • In general, the farther you are from other road users, the A. lower your crash risk B.higher your crash risk C. slower they are
    6·1 answer
  • What are the values of the following expressions? In each line assume that,
    7·1 answer
  • The definition of network is:
    10·1 answer
  • Juan wrote a loop to print all the prime numbers between 1 and 100. But instead of stopping at 100, it continues on and on forev
    5·1 answer
  • the image on the right was prooduced by a computer. it shows a complex molecu;e consisting of many atoms. what would be an advan
    6·1 answer
  • which of the following is the most appropriate way to write css style for the font family property in html
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!