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
You can replace a formula with its function so it remains constant. true or false.
kumpel [21]
True/Function. You can replace a formula with its function so it remains constant.
4 0
3 years ago
Statistics are often calculated with varying amounts of input data. Write a program that takes any number of integers as input,
katen-ka-za [31]

Answer:

txt = input("Enter numbers: ")

numbers = txt.split(" ")

total = 0

max = 0

for i in numbers:

     total = total + int(i)

     if(int(i)>max):

           max = int(i)

print(round(total/len(numbers)))

print(max)

Explanation:

This solution is implemented using Python programming language

This prompts user for input

txt = input("Enter numbers: ")

This splits user input into list

numbers = txt.split(" ")

The next two line initialize total and max to 0, respectively

total = 0

max = 0

This iterates through the list

for i in numbers:

This sum up the items in the list (i.e. user inputs)

     total = total + int(i)

This checks for the maximum

     if(int(i)>max):

           max = int(i)

This calculates and prints the average

print(round(total/len(numbers)))

This prints the max

print(max)

4 0
3 years ago
Your bank contacts you to phone a number supplied in the email. What do you do?
never [62]
Login thru a secure portal and verify messages and then report any issues. also another thing you may call your bank to make sure they are the ones who sent the email.
5 0
3 years ago
Which is needed for the specific task of inserting a chart into a report?
Arturiano [62]

To add charts in Access to reports, click the “Create” tab in the Ribbon. Then click the “Report Design” button in the “Reports” button group. Unlike other report controls, the chart control uses its own data source to show its data. Therefore, you can insert it into a blank, unassociated report, if desired

6 0
3 years ago
Place the following eras of IT infrastructure evolution in order, from earliest to most recent:
Sedaia [141]

Answer:

The correct option to the following question is B.) 5, 4, 2, 3, 1.

Explanation:

Personal Computer - In year 1975, E.d Roberts was coin the term as "personal computer" when he was introduced Altair 8800. The first PC (personal computer) was considered by many to the KENBAK-1, that was the first introduced for $750 in year 1971.

Mainframe and Minicomputer - Mainframe era was the periods of the highly centralized computing which controlled by the programmers and the system operators.

The Minicomputer was powerful yet it is less expensive computers that began to change the pattern and allow the decentralized computing which is customizable to an individual departments or the business units.

In the client/server computing - the laptop or the desktop computer systems called clients which are networked to the powerful server computers that provides client computers with the variety of the capabilities and the services.

Enterprise Era - In the early year 1990s, the firms are turned in to the networking standards and the software tools which could be integrated disparate the networks and the applications throughout the firm into the enterprise wide infrastructure. The Internet was developed into the trusted communication environments after the year 1995, the business firms was began seriously for using TCP/IP (Transmission Control Protocol/Internet Protocol) networking standards for tie their disparate network together.

5 0
4 years ago
Other questions:
  • The ____ operator eliminates duplicate values in the results of a query.
    11·1 answer
  • ________ is the amount of data that can be transmitted across a transmission medium in a certain amount of time.
    15·1 answer
  • Two-dimensional array indexes are listed as
    8·1 answer
  • Help verify each identity<br><img src="https://tex.z-dn.net/?f=%20%5Cfrac%7Bcsc%7D%7Bcot%20%5C%3A%20x%20%20%5C%3A%20%2B%20%20%5C
    9·1 answer
  • Jane Estroisch works as a manager in a multidomestic firm. She focuses on the long-term questions facing the organization such a
    15·1 answer
  • What is the useful chart used for comparing values over categories?​
    8·1 answer
  • Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
    15·1 answer
  • I put 100 points in here
    9·1 answer
  • The Table Design and Layout tabs are available under the
    13·2 answers
  • The science of how an object reacts to its motion through air is called _______________. (12 letters)
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!