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
Naddik [55]
3 years ago
12

Write a function to reverse a given string. The parameter to the function is a string. Function should store the reverse of the

given string in the same string array that was passed as parameter. Note you cannot use any other array or string. You are allowed to use a temporary character variable. Define the header of the function properly. The calling function (in main()) expects the argument to the reverse function will contain the reverse of the string after the reverse function is executed.
Computers and Technology
1 answer:
babymother [125]3 years ago
6 0

Answer:

Following are the program to this question:

#include <iostream> //defining header file

using namespace std;

void reverse (string a) //defining method reverse  

{

for (int i=a.length()-1; i>=0; i--)  //defining loop that reverse string value  

 {

     cout << a[i];  //print reverse value

 }

}

int main() //defining main method                                                                                          

{

string name; // defining string variable

cout << "Enter any value: "; //print message

getline(cin, name); //input value by using getline method

reverse(name); //calling reverse method

return 0;

}

Output:

Enter any value: ABCD

DCBA

Explanation:

In the above program code, a reverse method is declared, that accepts a string variable "a" in its arguments, inside the method a for loop is declared, that uses an integer variable "i", in which it counts string value length by using length method and reverse string value, and prints its value.

  • In the main method, a string variable "name" is declared, which uses the getline method.
  • This method is the inbuilt method, which is used to input value from the user, and in this, we pass the input value in the reverse method and call it.  
You might be interested in
An enhancement to a computer accelerates some mode of execution by a factor of 10. The enhanced mode is used 50% of the time, me
Ann [662]

Answer:

The answer is "5.5 and 90.90%"

Explanation:

For point 1:

To calculate the speed from fast mode, its run time without enhancement should be worked out. Designers are aware of which two selves are implicated throughout the accelerated project planning: the empty (50 \%) and the increased stages (50 \%).

Although not enhanced, this would take almost as long (50 \%) and for the combine to give phase; even so, the increased phase would've been 10 times longer, as well as 500 \%. Thus the corresponding total speed without enhancement is =50\% + 500\% = 550\%.

Its overall speed is:

=\frac{\text{Accelerated runtime}}{ \text{accelerated  runtime}} = \frac{550 \%}{ 100 \%}= 5.5

For point 2:

We re-connect these figures in Amdahl's Law throughout order to identify how long it would take for both the initial implementation:

\text{Vectorized fraction}= \frac{\text{Overall velocity}\times \text{Accelerated acceleration}-\text{Accelerated acceleration}}{\text{Overall acceleration} \times \text{Accelerated acceleration}-\text{Overall acceleration}}

                              = \frac{5.5  \times 10 -10 }{ 5.5 \times 10 - 5.5}\\\\=\frac{45}{49.5}\\\\=0.9090\\\\=90.90\%

5 0
3 years ago
When paying bills online, a payee is:
Andru [333]

The payee is the one that you send the money to. You are the payer.

Like employer the one that hires people, employee the one that is being hired


3 0
3 years ago
Which type of file can be opened directly into Excel?
lisov135 [29]

Answer:

Explanation: Select Change.

Select More apps.

Select the desired app, then select the to Always use this app checkbox.

Select the OK button.

4 0
3 years ago
I want to solve this question
slega [8]

Answer:

cant read too blurry

Explanation:

5 0
3 years ago
You're the network administrator for a company that has just expanded from one floor to two floors of a large building, and the
pogonyaev

Answer: (2) Internetwork

Explanation:

 According to the question, the inter-network should be configured as the inter-network is the type of network that are formed by connecting all the inter network together in which the user can easily communicate with each other.

 This can be done by using the efficient technique which is known as inter-networking. It is the technique that ensure the data communication and it is operated by using different types of entities by using internet routing protocol.

Therefore, Option (2) is correct.

6 0
3 years ago
Other questions:
  • ​a(n) ____ is a communications device that connects a communications channel such as the internet to a device such as a computer
    11·1 answer
  • The array index can be any nonnegative integer less than the array size.
    10·1 answer
  • Users generally do not understand the concept of network drive sharing. they only know they can store their files "on my f: driv
    8·1 answer
  • Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. E
    7·1 answer
  • Which of the following is the most accurate description of what is known as the "digital divide". The digital divide is about ho
    5·2 answers
  • Is there a policy on Bainly about using notes from previous class sessions with definitions gained from googling them at the tim
    10·1 answer
  • If you are asked to list your favorite websites in no particular order, you are relying on
    8·1 answer
  • Which of the following is the most important system if a company wants to consolidate fan data from multiple sources, i.e., exte
    11·2 answers
  • What are the two ways to print a document?
    11·1 answer
  • An OCA previously classified a recent government breakthrough in energy technology as Confidential. The military is developing a
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!