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
If the Snort IDS captures the IP packets off the LAN segment for examination, is this an example of promiscuous mode operation
vodomira [7]

Answer:

i now why read this

Explanation:

We're no strangers to love

You know the rules and so do I

A full commitment's what I'm thinking of

You wouldn't get this from any other guy

I just wanna tell you how I'm feeling

Gotta make you understand

Never gonna give you up

Never gonna let you down

Never gonna run around and desert you

Never gonna make you cry

Never gonna say goodbye

Never gonna tell a lie and hurt you

We've known each other for so long

Your heart's been aching but you're too shy to say it

Inside we both know what's been going on

We know the game and we're gonna play it

And if you ask me how I'm feeling

Don't tell me you're too blind to see

Never gonna give you up

Never gonna let you down

Never gonna run around and desert you

Never gonna make you cry

Never gonna say goodbye

Never gonna tell a lie and hurt you

Never gonna give you up

Never gonna let you down

Never gonna run around and desert you

Never gonna make you cry

Never gonna say goodbye

Never gonna tell a lie and hurt you

(Give you up)

(Ooh) Never gonna give, never gonna give

(Give you up)

We've known each other for so long

Your heart's been aching but you're too shy to say it

Inside we both know what's been going on

We know the game and we're gonna play it

I just wanna tell you how I'm feeling

Gotta make you understand

Never gonna give you up

Never gonna let you down

Never gonna run around and desert you

Never gonna make you cry

Never gonna say goodbye

Never gonna tell a lie and hurt you

Never gonna give you up

Never gonna let you down

Never gonna run around and desert you

Never gonna make you cry

Never gonna say goodbye

Never gonna tell a lie and hurt you

Never gonna give you up

Never gonna let you down

Never gonna run around and desert you

Never gonna make you cry

Never gonna say goodbye

5 0
3 years ago
Which is NOT a valid compute shape option within the Oracle Cloud Infrastructure (OCI) compute service
inessss [21]

The option that is not a valid compute shape option within the Oracle Cloud Infrastructure (OCI) compute service is;

A: Container Instance

<h3>Cloud Computing</h3>

Cloud computing is simply a system that makes use of the Internet to store, manage and access data from a remote server on the internet.

Now, this cloud system infrastructure makes use of middleware software to ensure that there is proper connectivity between devices and computers connected via the cloud.

Finally there are different types of cloud computing shape but among the given options the only one that is not a type is Option A.

The missing options are;

A) Container Instance.

B) Bare Metal.

C) Dedicated Virtual Machine Host.

D) Virtual Machine.

Read more about cloud computing at; brainly.com/question/19057393

6 0
2 years ago
In python how do you write for prime factors
olasank [31]

Answer:

The while loop is used and the factors of the integer are computed by using the modulus operator and checking if the remainder of the number divided by i is 0. 3. Then the factors of the integer are then again checked if the factor is prime or not.

Explanation:

google

4 0
3 years ago
Pathways in the Science, Technology, Engineering, &amp; Mathematics Career Cluster include:
ZanzabumX [31]

Answer: wanna say engineering technology and science and mathematics

Explanation:

7 0
3 years ago
Why does fiber optic communication technology have a significant security advantage over other transmission technology? higher d
erik [133]
Higher data rates can be transmitted Hope this helps!
7 0
3 years ago
Other questions:
  • How many possible password of length four to eight symbols can be formed using English alphabets both upper and lower case (A-Z
    11·1 answer
  • What is <br> central vision
    12·2 answers
  • Which do web servers host?<br> Websites<br> Networks<br> Firewalls<br> Zones
    8·1 answer
  • Place the steps in order to link and place text into the document outline, effectively creating a master document.
    8·1 answer
  • Please find one organization that has recently adopted virtualization and summarize their reasons for taking this approach. What
    12·1 answer
  • What are the two ways to print a document?
    11·1 answer
  • Dash transfers several bits of data together at one time<br>​
    6·1 answer
  • In Python, the data structure that stores elements of the same data type is called an array.
    6·1 answer
  • Examples of how the development of coding changed the way we live. What type of technology was created as a result of code?
    10·1 answer
  • Once you select a theme, you__________ change the theme’s individual elements independently of each other.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!