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
lawyer [7]
3 years ago
14

Write a program that inputs a line of text and uses a stack object to print the line reversed.

Computers and Technology
1 answer:
Lina20 [59]3 years ago
8 0

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

   string ms;

   getline(cin,ms);

   stack<char>st;

   for(int i=0;i<ms.length();i++)//Inserting every element in the stack..

   {

       st.push(ms[i]);

   }

   while(!st.empty()) //doing operation until the stack is not empty..

   {

       char a=st.top();//accessing the top element of the stack...

       st.pop();//removing the head.

       cout<<a;//printing the character..

   }

return 0;

}

Input:-

murder

Ouput:-

redrum

Explanation:

An  easy way to reverse anything is to use stack.Since stack is LIFO type data structure so the last item in will be the first one to get out hence it reverses the elements.So inserting every element of the string into the stack of characters and then printing the every element of the stack from top to bottom.

You might be interested in
Part 2: Code the Program
OverLord2011 [107]

Answer:

# Name - Today's Date

# Description

def main():

    print("My favorite TV show is Mythbusters.")

    print("I like it because I learn a lot and they do crazy experiments.")

main()

(this is the best I can do since it's a specific result based on the choices you make, but I did the example code and you just need to fill it in with the necessary requirements. I also tested it on IDLE. )

8 0
3 years ago
Match the installation type to its description.
MariettaO [177]

Answer:

Following are the types of installation matched to its respective definitions.

<h3>Upgrade installation:</h3>

What you do when you have a computer with an existing operating system that needs to be upgraded.

This means that while working on a window when you get attracted by the update introduced recently and you upgrade your window accordingly.

For example: Updating a window from 8 to 10 or desired features.

<h3>Multiple boot installation:</h3>

What you do when you have several operating systems on one computer.

In this type of installation, a computer has different windows for different accounts. You can boot to the desired installed window by switching account.

<h3>Clean installation:</h3>

What you do on a brand new computer that has never been set up before and does not have an operating system on it yet.

It can be defined as the installation of window done very first time on to the computer. Sometimes when the window gets deleted due to virus or any other factor, the installation at that time will also be termed as Clean Installation.

<h2>I hope it will help you!</h2>
5 0
3 years ago
What console can be used to enable disable start or stop a service
umka21 [38]
That would be msconfig!
5 0
3 years ago
Which three decisions might a specialized drone delivering medical supplies make once it's algorithm has started and it is scann
densk [106]

The decisions that a specialized drone delivering medical supplies make once it's algorithm has started and it is scanning its surround are:

  • A  tilt backyard when sensor detects an obstacle within 10 feet.
  • To disable self flying and alert pilot when sensor detects an obstacle within 3 feet.
  • To resume normal speed when sensor doesn't detect an obstacle within two feet.

<h3>How are drones used in healthcare?</h3>

Hospitals are known to have started  using drones to transport laboratory samples and also to carry out other kinds of humanitarian aids.

The use of  drones  is said to be one that is cost-effective and it is one that bring blood products, vaccines, medical supplies, and others to rural areas or areas that has small infrastructure.

A drone can find way to move around obstacles but they should not shut down where there is obstacle.

Learn more about drone from

brainly.com/question/24530012

5 0
3 years ago
Lael Masterson works in the Student Activities Office at Valerian State College in Illinois. Lael has started compiling informat
Nina [5.8K]

Answer:

Use the HLOOKUP function in the cell E2 by specifying the student's hourly rate value, the range of cells of the table holding the information, the row from which to return the value, and a value of true or false for approximate or exact match respectively.

Explanation:

Microsoft Excel is a statistics tool used for data analysis. It has several functions and graphical properties for cleaning and representing data.

The HLOOKUP function is an example of a search function in excel, it returns a value based on another value from a range of cells. The function accepts four arguments, they are, the value to be searched, the range table or cell range to search, the row to get the search value, and a mode of return value to return, could be either true for an approximate match or false for an exact match.

6 0
3 years ago
Other questions:
  • Question 1 of 20 :
    15·2 answers
  • What considerations have to be kept in mind with JPEG
    10·1 answer
  • How many apostrophes or quotation marks in a row should you use to begin and end a multi-line string?
    14·2 answers
  • What sends massive amounts of email to a specific person or system that can cause that user's server to stop functioning? mail b
    6·1 answer
  • ________ are websites that provide collections of content from all over the world wide web a. aggregators b. social networks c.
    6·1 answer
  • What are the properties of magnetic field​
    8·1 answer
  • Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
    7·1 answer
  • 6. Python indexes lists beginning with the number 1.<br> True<br><br> False
    15·1 answer
  • You attempt to telnet to system 192.168.1.240. You receive the following message: "Connecting To 192.168.1.240...Could not open
    5·1 answer
  • when working with smart which tab would provide the ability to change the shape or size of the smart art shapes
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!