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]
2 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]2 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
____ is the use of networking technology to provide medical information and services.
Cerrena [4.2K]
Answer: WebMD

WebMD, with the URL https://www.webmd.com, provides credible health and medical information on the web.
3 0
3 years ago
Which technology can be used as a defense against dos and ddos syn flood attacks?
Montano1993 [528]
In terms of websites, there's a service called cloud flare which can prevent DDOS attacks in websites. Other applications you would have to look up. Hopefully this helps!
6 0
3 years ago
Daniel was appointed one of three princes over all 120 governors in the kingdom of: Belshazzar, Darius, Nebuchadnezzar, Jerioaki
Dovator [93]
The correct answer is DARIUS.
It is written in the bible in Daniel chapter 6 verses one and two: ' It pleased Darius to set over the kingdom 120 satraps, to be over the whole kingdom. And over these, three governors of whom Daniel was one, that the satraps might give accounts to them, so that the king would suffer no loss. 
5 0
3 years ago
A virus that propagates using the internet or another computer network is called __________.
olasank [31]
This is called a worm
8 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
trasher [3.6K]

syntax are programming languages that specify a series of structured functions. C is an example of such a language.

7 0
3 years ago
Other questions:
  • Which term describes a protocol to manage a network, able to configure a network, monitor activity, and control devices?
    10·2 answers
  • A high-angle shot is the same thing as a bird’s-eye shot. True False
    11·2 answers
  • The chart shows changes in sea level from 1995 to 2013. According to the chart, sea levels rose at an average annual rate of 3.2
    6·2 answers
  • How many bytes make up a megabyte? One hundred One thousand One million One billion
    12·1 answer
  • After completion of this chapter, you should be able to:  Describe the structure of an IPv4 address.  Describe the purpose of
    5·1 answer
  • Any part of the computer that you can touch is called ________.
    6·1 answer
  • Write a game that plays many rounds of Rock Paper Scissors. The user and computer will each choose between three items: rock (de
    8·1 answer
  • Where does the list of incoming mail appear in gmail
    13·2 answers
  • Explain steps in creating a main document for from letter. <br>​
    5·1 answer
  • Which technology can be implemented as part of an authentication system to verify the identification of employees?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!