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
PLEASE HELP<br>what are some benefits of using graphic on web page?​
qwelly [4]

Images help tell a story where describing with words is either too lengthy, or practically impossible. For instance, you could have a map of a location and various arrows and other markings to describe movements of troops during a battle of the civil war. This is one example of many that you could have as an image on a website. Describing the troop movements with words only may be really difficult to do. Plus many people are visually oriented learners, so they benefit with images every now and then. Of course, it's best not to overdo things and overload the site with too many images. A nice balance is needed.

5 0
3 years ago
1. Create a constructor definition that has two parameters, a manufacturer’s brand and a screen size. These parameters will brin
katen-ka-za [31]

Answer:

C++.

Explanation:

#include <iostream>

#include <string>

using namespace std;

////////////////////////////////////////////////////////////

class Television {

   string brand;

   float screen_size;

   bool powerOn;

   int volume;

   int channel;

   

public:

   // Comments

   Television(string brand, int screen_size) {

       this->brand = brand;

       this->screen_size = screen_size;

       powerOn = false;

       volume = 20;

       channel = 2;

   }

   //////////////////////////////////////////

   // Comments

   int getVolume() {

       return volume;

   }

   

   // Comments

   int getChannel() {

       return channel;

   }

   

   // Comments

   string getManufacturer() {

       return brand;

   }

   

   // Comments

   float getScreenSize() {

       screen_size;

   }

   ///////////////////////////////////////////

   // Comments

   void setChannel(int channel) {

       this->channel = channel;

   }

   

   // Comments

   void power() {

       if (!powerOn)

           powerOn = !powerOn;

   }

   

   // Comments

   void increaseVolume() {

       volume = volume + 1;

   }

   

   // Comments

   void decreseVolume() {

       volume = volume - 1;

   }

};

3 0
3 years ago
You can copy and paste ________ from excel to powerpoint
Tanya [424]

Answer: data

Explanation:

3 0
3 years ago
Read 2 more answers
Which statement accurately describes a bitmap graphic?
igomit [66]

Answer:

It uses small dots (usually thousands) to create images and specify colors is the correct answer.

Explanation:

A bitmap graphic is also known as raster, and it is created by putting together rows of pixels. Later, these pixels will form a complete image, that could only be black and white (using only these colors) or similar to a photography (which will lead to use as many colors as necessary). Different programs are used to create bitmap graphics.

4 0
4 years ago
List all the connectors or components that can be connected internally to the motherboard
Amiraneli [1.4K]

A computer’s motherboard has a series of slots and connectors. Slots allow daughter boards to be plugged directly while connectors allow communication through cables with other peripheral devices. CPU sockets, Hard Drive connectors, Memory sockets, and Power connector are examples of components that can be connected internally in some way to the motherboard. Other physical devices include RAM, hard disks, and graphics card.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Oliver is creating an image of a fruit basket. From the basket, he wants the red apples to stand out among the rest so they will
    9·1 answer
  • Why is it unlikely that you will find the ip address 192.168.250.10 on the internet?
    15·1 answer
  • You are preparing to program a replacement system board, but the "system is booting in mpm mode" message is not displayed. what
    10·2 answers
  • Write a program that sorts a vector of names alphabetically using the selection sort and then searches the vector for a specific
    7·1 answer
  • Artificial intelligence seeks ways to improve a computer's capabilities in ____ and reasoning tasks. intellectual computational
    13·1 answer
  • What is the most effective way to demonstrate being prepared for an interview?
    13·1 answer
  • Plz can someone tell me the answers ?
    13·2 answers
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • ......... mi2hej<br><br>ejid8eo19o1b2bxhxjxjdnneejk2929nr
    5·2 answers
  • 我对汉语的兴趣 làm đoạn văn theo đề trên​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!