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
balu736 [363]
3 years ago
8

Write a program that initializes a string with Mississippi Then replace all i with ii and print the length of the resulting stri

ng. In that string replace all ss with s and print the length of the resulting string.
Computers and Technology
1 answer:
Katyanochek1 [597]3 years ago
3 0

Answer:

Explanation:

#include <bits/stdc++.h>  

using namespace std;  

string replace(string s, char c1, char c2)  

{  

   int l = s.length();  

 

   // loop to traverse in the string  

   for (int i = 0; i < l; i++) {  

 

       // check for c1 and replace  

       if (s[i] == c1)  

           s[i] = c2;  

 

       // check for c2 and replace  

       else if (s[i] == c2)  

           s[i] = c1;  

   }  

   return s;  

}  

 

// Driver code to check the above function  

int main()  

{  

   string s = "Mississippi";  

   char c1 = 'i', c2 = 's';  

   cout << replace(s, c1, c2);  

   return 0;  

}

You might be interested in
Zac works in the robotics industry. He assists in assembling robots. He also carries out regular inspections at industries that
loris [4]

Answer:

Robotics Engineer

Explanation:

This is a designation for those like Zac who have loads of patience, and also a lot of experience in Engineering. It's the Engineers like Zac who is responsible for figuring out the robots on paper. And this takes quite an effort as they have to do a lot of research as well as should be technically sound as well as sophisticated in Robotics. Note, Zac assists in assembling Robots, and this can only be done by a Robotics Engineer. And Zac also carries regularly the inspection of the industries which have bought his organization's Robots. And he finds if they are functionally sound. And that can be done by only a Robotic Engineer, And he is hence, certainly a Robotic Engineer.

7 0
3 years ago
Read 2 more answers
After brainstorming engineers may refine their ideas by making
trasher [3.6K]
An prototype mean an working model used to test a design
7 0
3 years ago
10 disscused reasons why organisatoions use electronic spreedsheet​
alina1380 [7]

Well, In any accounting role, you can benefit from incorporating spreadsheets into everyday tasks, making your job streamlined and easier to manage. If you’re looking to progress onto AAT Level 3 Advanced Diploma, it’s good to see how spreadsheets can support you.

a) Easy payment tracking  - While small business owners and those new to accounting can find it difficult to track payments, spreadsheets offer a simple solution.  Spreadsheets are commonly used to analyse money that has been spent and income that has been received. They allow you to split the amount of money you have spent and received by time period and source. For example, you can separate out different types of expenditure such as rent or insurance, and track exactly how much can been spent on these in each month, by using a simple table.

8 0
3 years ago
Convert the following 8­bit binary numbers in two's complement format to decimal (If the number is negative, include the minus s
olchik [2.2K]
Ahhh we rjfydyxtxyztxhxhxhxtzgxgxgxtxftxtxtxtxt gc
6 0
3 years ago
Earthquakes happen when _____.
skad [1K]
The answer is C. The third choice.
4 0
3 years ago
Other questions:
  • When looking at an object or process to code, it is important to think of as general a solution as possible and consider all the
    13·1 answer
  • What is the difference between a software package and integrated software
    7·1 answer
  • What must be done to translate a posttest loop expressed in the form
    9·1 answer
  • __________ refers to the idea that eachemployee should report
    14·1 answer
  • A tool in Word that creates multiple copies of the same letter, envelope, or label and inserts personalized data is a(n) _____.
    12·1 answer
  • What is the main advantage of using a WYSIWYG("what you see is what you get")editor when constructing a website
    5·1 answer
  • Explain the risks to privacy from collecting and storing personal data on computer systems and the programmer’s role to safeguar
    11·1 answer
  • State the advantages of MS Excel in data encoding
    9·1 answer
  • This class is missing a number of functions. Rewrite the class declaration to follow best practices, e.g, operators, three impor
    10·1 answer
  • What are software applications?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!