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
valina [46]
3 years ago
12

Write a c++ program that accepts a string from the user and then replaces all occurrences of the letter e with the letter x

Computers and Technology
1 answer:
mixer [17]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   string str;

   cout<<"Enter the string: ";

   cin>>str;

   for(int i=0;str[i]!='\0';i++){

       if(str[i]=='e'){

           str[i]='x';

       }

   }

   cout<<"the string is: "<<str<<endl;

  return 0;

}

Explanation:

First, include the library iostream for using the input/output instructions.

Create the main function and declare the variables.

Then, use the cout instruction and print the message on the screen.

cin store the string enter by the user into a variable.

After that, take a for loop and if-else statement for checking the condition if the string contains the 'e', then change that alphabet to 'x'.

This process continues until the string not empty.

Finally, print the updated string.

You might be interested in
Earthquakes _____.
rosijanka [135]
<span>B: can be caused by volcanic eruptions</span>
7 0
3 years ago
Read 2 more answers
In spreadsheet programs, labels and constant values are always copied exactly to the new location; what happens to formulas when
Dima020 [189]

Answer:

absolute cell referencing

Explanation:

Excel has an A1 reference style, which means that the columns are called letters A to XFD and the rows have numbers, 1 to 1,048,576. The total number of columns in Excel 2007 is 16384.

A cell can contain a value, formula or constants. A formula begins with a sign = (equal). You can use values ​​from other cells in your formula. To use another value, create a reference to the cell that contains the value you want to use in your formula.

When you copy a cell that contains a relative reference and paste it into another cell, the relative reference changes

When you copy a formula that contains relative references, the reference changes when you paste it into another cell.

How much the reference changes in relation to the position of the copied cell and the position of the new cell in which the formula is pasted. Excel uses relative references by default.

Instead, an absolute reference in a formula remains the same if it is copied to another cell.

8 0
4 years ago
A(n) ________ is the portion of virus code that is unique to a particular computer virus. A) virus signature B) encryptio
tino4ka555 [31]

Answer:

A) virus signature

Explanation:

Antivirus databases contain what are called signatures, a virus signature is a continuous sequence of bytes that is common for a certain malware sample.

--

Encryption is a way of scrambling data so that only authorized parties can understand the information.

7 0
2 years ago
Write code which takes inputs and creates two Rectangle objects (using the edhesive.shapes.Rectangle class) and compares them us
iogann1982 [59]

Answer:

System.out.println("Enter length:");

Scanner scan = new Scanner(System.in);

Double x = scan.nextDouble();

System.out.println("Enter 2 lengths:");

Double a = scan.nextDouble();

Double b = scan.nextDouble();

Rectangle rect = new Rectangle(x);

Rectangle rect2 = new Rectangle (a,b);

if (rect2.equals(rect)){

 System.out.print("Congruent Rectangles");

}

else {

 System.out.print("Different Rectangles");

}

 }

}

Explanation:

6 0
3 years ago
Why can’t a computer use source code
Elina [12.6K]

Answer:

A computer can use a source code

Explanation:

The code that was copied

gets compiled by the terminal and

gets its traced erased

therefore there is no need to give

credit and code still used in proccess

Example:

You can get a source code from stackoverflow

github, you can use that code to build your website

giving no credit to the owners of that code

the code will get its traced erased by the compiler

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which two ways should a developer create this functionality? A developer is asked to create a PDF quote document formatted using
    13·1 answer
  • How do i cancle my account on brainly
    11·1 answer
  • If you need to write a function that will compute the cost of some candy, where each piece costs 25 cents, which would be an app
    5·1 answer
  • A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Ab
    11·1 answer
  • How does design influence the product's function?
    5·1 answer
  • Explain why the computer is powerful working tool???​
    7·1 answer
  • Overview In this assignment, you will gain more practice with designing a program. Specifically, you will create pseudocode for
    7·1 answer
  • A protocol stack is _____.
    11·2 answers
  • Which approach to bandwidth usage consumes all of the available frequencies on a medium to transmit data
    7·1 answer
  • write a recursive function that accepts an integer argument, n. the function should display n lines of asterisks on the screen,
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!