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
1) a program that is designed to perform only one task.
JulijaS [17]

Answer:

special purpose application software

Explanation:

it is a type of software created to execute one specific task.for example a camera application on your phone wul only allow you to take and share pictures.

Other example of special purpose application are web browsers,calculators,media playors,calendar programs e.t.c.

7 0
3 years ago
Suppose you've decided to write a function template that you expect to use in many different source files. Suppose, further, tha
Sladkaya [172]

Answer:

The Solution to the given question can be defined as follows:

Explanation:

Please find the complete question in the attachment file.

In this case, the compiler will try to correct the model type by both the form we used when we try and call the method with both the appropriate form variable. It type of function. Consequently, unless the function in another file is specified, the compiler cannot locate the digital strategy. The point to note here is that only when this code is used, the template code shall be compiled.

The construct component will therefore be efficient so in this case, its connection stage would fail. An undefined connection to the feature <function name> can constitute a possible error in this case. It rules, therefore, address the construction project problem. Furthermore, the template function throughout the main program is generally recommended. It can be solved alternatively because parameters of a template like <function name><type> could be specified throughout the CPP file.

8 0
3 years ago
alex needs to email his graduation certificate to a prospective employer. he has only physical copies of the certificate. what d
svlad2 [7]
He should use a scanner, which would convert an image into an electronic file.
7 0
2 years ago
What diagnostic software is used by several manufacturers, and can run tests on keyboards, video, speakers, touchpad, optical dr
PilotLPTM [1.2K]

Answer:

PC doctor is a diagnostic software used by several manufacturers, and can run tests on keyboards, video, speakers, touchpad, optical drives, wireless LANs, motherboard, processor, ports, hard drive, and memory

Explanation:

PC Doctor is an adware included for free by other programs. It lets you test all the hardware of the computer, analyze its status and see the details as well as to confirm the bios version. However, it also helps you optimize their functionality by making the process of connecting those elements to the computer in an easier way. However, the PC doctor also adds publicity to your computer and was subject to hack exposure in 2019.

4 0
3 years ago
2 The following image shows the number of orders Company A received in 2015-2020. A financial analyst wants to calculate the yea
Marina CMI [18]

In the above case, the thing to do is to Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R.

<h3>What are Computer shortcuts?</h3>

A computer shortcuts are known to be a composition of one or a lot of keys that bring about a command in software or operating system.

Hence, In the above case, the thing to do is to Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R.

See options below

Select cell C4, then press Ctrl + Shift + R

Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R

Select cell C4, then press Ctrl + R

Press Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R

Learn more about Computer shortcuts  from

brainly.com/question/12531147

#SPJ1

5 0
2 years ago
Other questions:
  • • Describe the steps in detail that the operating system performs to handle interrupts, including ISRs, the stack, and hardware?
    5·1 answer
  • Is a fundamental building block of a relational database because this object stores all of the data
    15·1 answer
  • The work principle is not always true<br> T or F
    11·2 answers
  • How does the access point know whether a wireless data packet is intended for its network?
    14·1 answer
  • How do you record yourself on a macbook pro
    9·1 answer
  • How do you turn on the Track Changes feature in a word-processing document?
    12·1 answer
  • True or False (type the entire word)
    11·1 answer
  • In Scheme, the form (symbol-length? 'James) will return: Group of answer choices 0 5 6 error message
    11·1 answer
  • What is a word processing program? Give examples of word processing programs.
    10·1 answer
  • Most of the internal operations in a computer use hexagonal numbering true or false
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!