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
Oduvanchick [21]
3 years ago
8

[C++] 4.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in

reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done then the output is: ereht olleH yeH
Computers and Technology
1 answer:
Readme [11.4K]3 years ago
7 0

The program illustrates the use of string manipulations.

String manipulation involves carrying out several operations (such as splitting and reversing of strings).

The program in C++ where comments are used to explain each line is as follows:

#include <bits/stdc++.h>

using namespace std;

int main(){

   //This declares a string variable

string str;

//This gets input for the variable

getline(cin, str);

//The following is repeated, until the user inputs <em>"Done", "done" or "d"</em>

while(str != "Done" && str !="done" && str !="d"){

    //This reverses the string

    reverse(str.begin(), str.end());

    //This prints the reversed string

    cout << str<<endl;

    //This gets another input

    getline(cin, str);

}  

return 0;

}

At the end of each loop, the reversed string is printed.

See attachment for sample run

Learn more about similar programs at:

brainly.com/question/24833629

You might be interested in
3
sergiy2304 [10]

Answer: I believe this would be A.) choosing an alternative

Explanation:

6 0
3 years ago
Read 2 more answers
You are creating a budget for your new business.What should you include
aev [14]

Answer:

When operating a business, your budget will need to be created to account for fixed and variable costs. Fixed costs include your rent, utilities, phone/ Internet, accountant, legal fees, technology, salaries, advertising & marketing. Variable costs include the costs of goods sold and labor costs/ commissions.

Explanation:

5 0
4 years ago
You cannot advance slides during the slide show by pressing the PAGE DOWN key
noname [10]
<span>You cannot advance slides during the slide show by pressing the PAGE DOWN key.
This is a true statement.
</span>
4 0
3 years ago
Take any software or Application that you have recently purchased, this can be a video game or any other application helping you
IgorC [24]

A good product should have copyright protection which prevents others from using the product without permission.

Some products specify the penalties which are given to a person who makes unauthorized copies of their product and this is done to clearly educate to avoid ignorance claims.

A good product should have clear lettering which are legible and can be easily read, and should also have reasonable copyright protection.

<h3>What is Copyright?</h3>

This refers to the licensing which is done for a product and is also legally backed which prevents a person from illegally using or redistributing the work of a creator without their explicit consent.

Read more about copyright infringement here:
brainly.com/question/1078532

8 0
2 years ago
During the troubleshooting of a pc that will not boot, it is suspected that the problem is with the ram modules. the ram modules
Damm [24]
The modules were somehow disconnected
8 0
4 years ago
Other questions:
  • What microprocessor was the first to be processable<br> ?
    14·1 answer
  • What important information is added to the TCP/IP transport layer header to ensure communication and connectivity with a remote
    13·1 answer
  • How to access files on different computer same network
    14·1 answer
  • Write a method called printRange that accepts two integers as arguments and prints the sequence of numbers between the two argum
    6·1 answer
  • Around what time did the Internet come around and how did it all start? Would like to know more of the history of how the intern
    12·1 answer
  • Heidi uses her computer to write articles for a newspaper. She uses a program to listen to the articles before she submits them
    5·1 answer
  • Can someone help me i need to write something for cyber bullying
    11·2 answers
  • Can change the tab colors of the worksheets in excel
    13·1 answer
  • Write a C program that uses a while statement to determine and print the largest of 10 numbers input by the user. Your program s
    6·1 answer
  • Web résumés allow you to include extra graphics and images that you would not include in a traditional résumé. Please select the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!