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
Find the simple interest Jay owes on a five-year student loan of $48,000 with an annual interest rate of 5%.
Serjik [45]
P = $48,000
r (Rate) = 5%
t (Time) = 5 (Years)

Interest = Prt =(48,000)(0.05)(5)= $12,000

The simple interest is $12,000 over the course of 5 years, with an annual interest of 5% and a loan of $48,000

I hope that answers your question! (I'm new to this app so sorry if that's not what you were looking for!)
8 0
4 years ago
A user calls to report that she is experiencing intermittent problems while accessing the wireless network form her laptop compu
earnstyle [38]

Answer:

The user is out of the effective range of the wireless access point on her floor.

Explanation:

This user is obviously not close to the access point. As help desk, if a user ever calls to complain about slow speeds or intermittent connectivity while trying to access the network, the first question that you should ask them is how far out are they from the modem or the Access Point. The location between her and the access point might affect the performance of the wireless network. Since she is working from the break room that is two floors above the floor where she normally works, then this means that the walls and ceilings will act as an obstruction to the Wi-Fi signal. The number of Walls and other obstacles will obviously affect the range of the Wi-Fi and will limit the signal’s effectiveness. I will advise the user to go back to her initial working area or be within range to the access point.

6 0
3 years ago
Universal Containers (UC) is currently live with Sales Cloud and in the process of implementing Service Cloud. UC wants to creat
lora16 [44]

Answer:

  1. <u>Partial Copy Sandbox,</u>
  2. <u>Full Sandbox,</u>
  3. <u>Developer k Pro Sandbox</u>

Explanation:

Note that, cloud services are made possible by computer programming, and <em>soundboxes are used by Software developers to test new programming code before implementation</em>.

Therefore, for UC to successfully test its Service Cloud implementation with real Sales Cloud data this three soundboxes are best suitable.

3 0
3 years ago
Hi there. I need to know that if I take computer fundamentals, will that class teach anything about graphic design or digital de
Vedmedyk [2.9K]
Hi there!

I have taken a computer fundamentals class before and they did skim over the topic, but they did not go into depth on it at all. If you really want to learn about that stuff I suggest you find a course that is specifically on that topic or something that is closer related then a general <span>computer fundamentals course.

-Your friend in tech,
</span>ASIAX <span>  </span><span>Frequent Answerer</span>
8 0
3 years ago
The scope of a variable declared inside of a function is:
Feliz [49]

Answer:

The correct answer for the given question is option(a) i.e Local - within that function .

Explanation:

The variable which is declared inside any function are called as local variable The scope and lifetime of local variable is inside that block or function only.

They cannot access outside the function.

Following are the example of local variable

#include <stdio.h> // header file

void fun(); // function prototype

int main()// main function

{

fun(); //calling function

print("%d",t); // it gives error because t is local variable cannot access in main function

return 0;

}

void fun()

{

int t=9;// local variable

printf("t is local variable which value is:");

printf("%d",t);

}

As we seen that t cannot access outside the function .So correct answer is option(a)

7 0
3 years ago
Other questions:
  • If the object instance is created in a user program, then the object instance can access both the public and private members of
    9·1 answer
  • Why is Copyright important?
    5·1 answer
  • Part 2: students and courses, part 1  java review you may use an ide or a text editor, but i will test this by compiling and ru
    6·1 answer
  • What are the verison of ip user nearly limitless ip address?
    14·1 answer
  • If the processor has 32 address lines in its address bus; i.e. 32-bit address range, what is its address space or range; i.e. wh
    10·1 answer
  • Kayle is building a web form. He has included space where users can input their phone numbers and email addresses. However, he w
    15·1 answer
  • List the various types of social media that have been covered in the tutorial. Mention the key purposes for which each media typ
    9·1 answer
  • When you're working with a word processing document and you press the del key, what happens?
    6·2 answers
  • Create an old sample dictionary {0:10, 1:20} as follows to store numbers. Write a Python script to ask how many runs from user i
    11·1 answer
  • What is polymerization1​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!