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
GREYUIT [131]
3 years ago
6

Write a function called printbackwards() that will work with a c++ string. the function will print any c++ string backwards. you

don't need to put in the prototype, but you need to write a complete function.
Computers and Technology
1 answer:
dangina [55]3 years ago
6 0
Hi!

Well, this isn't exactly a question - but rather just a request. However, I'm going to attempt to try and <em>describe </em>to you how to approach this problem, instead of just writing the code for you and sending you on your way.

So, what's our general base goal here? We want to take a string into a function, and then print it out backwards. Seems simple enough!

Right away, we already have an idea how to set this code up. We need a main method which will call <em>PrintBackwards(), </em>which will have to take a parameter of type string. 

This would look something like <em>PrintBackwards(string baseString). </em>Inside this method, we'd have to do something so we can see each character in this string and then store it in a new string. 

I encourage you to try and tackle this on your own, but I can give you an idea. We can have a new valueless variable called reversedString, which will store our baseString but backwards.

We could try looping through the baseString for each character it possesses, and then keep adding onto our reversedString by doing something like +=. What I mean, is we'd access the very last index of baseString, and then keep appending characters into it. 

So our loop would look something like <em>for(int i = baseString.length; i > 0; i--) {}. 

</em>I haven't used C++ in awhile, so you'll have to find the specific syntax requirements. But with that loop, i represents the index of each character in baseString. It starts with the last index, and keeps going down in reverse.
<em>
</em>Inside our loop, we could do something like reverseString += baseString.index(i); Again, I don't remember the specific syntax - so you'll have to do this on your own.
<em>
</em>Hopefully, this helps! =)<em>
</em>
You might be interested in
To print the number of elements in the array named ar, you can write :
Diano4ka-milaya [45]

Answer:

Option c is correct.

Example :

public class Subject

{

public static void main(String [] args)

{

int ar[]={5,4,6,7,8};

System.out.println("the number of array elements are: ",ar.length);

}

}

Explanation:

The above program is created in java language in which Subject is a class name.Inside Subject class , there is main method.

Inside the main method, there is An array named 'ar' which data type is an integer and we have assigned the value to this array.

in the next line, we are printing the total no. of the element in the array with the length function which displays the length of an array or variable.

8 0
3 years ago
The sequence of Figures shows a pattern. if the pattern repeats, how many triangles will the figure 5 have ?​
Natali [406]

The number of triangles which is expected to be in the 5th figure in the sequence should be 5 triangles.

  • Analysing the sequence, the number of triangles in the first figure is 1.

  • The number of triangles in the second the figure is 2 and the third has 3 triangles.

  • This means that, the number of triangles in each figure increases by 1.

  • The number of figure 5 will thus have triangles corresponding to 5.

Therefore, since the number of triangles in each figure corresponds to the number which the figure occupies in the sequence, then the 5th figure will have 5 triangles.

Learn more :brainly.com/question/18796573

7 0
3 years ago
Having a conversation with someone using a cellular phone is an example of _____ transmission.A. full-duplexB. half-duplexC. ana
RUDIKE [14]

Answer:

A) Full-duplex

Explanation:

In data communication and networks, duplex refers to transmissions that occurs in two directions. Two types of this transmission is recognized, these are; full-duplex and half-duplex.

In a full-duplex, the data transmission in the two directions can occur at same time, the popular example of this is the cellular phone as the two persons on a phone can speak and hear each other both ways at the same time. The half-duplex on the other hand allows only a one-way data transmission at a time, the popular example is the walkie-talkie, only one party talks at a time.

6 0
4 years ago
What is a cell? how is it referred?​
Ugo [173]

Answer:

A cell is defined as that source of current electricity which converts chemical energy into electrical energy.

hopefully this was helpful.<3

6 0
3 years ago
Astrid’s computer screen suddenly says that all files are now locked until money is transferred to a specific account, at which
monitta

Answer:

Your answer would likely be ii

Explanation:

Most of the time these types of programs will behave like the one stated. They normally want you to pay with Bitcoin but it can vary like with Ethereum or really anything that's in the stock market! But it normally consists of Bitcoin

6 0
3 years ago
Other questions:
  • Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). O
    5·1 answer
  • Can anyone guide me on what to learn after C language?
    15·1 answer
  • A collection of related files that serves as a foundation for retrieving information is a: byte
    12·1 answer
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    11·1 answer
  • What is ATX full size motherboard? Tell its size as well?
    14·1 answer
  • A technician suspects a network card is not working. Which tool should the technician use to test the network card?
    8·1 answer
  • Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the
    5·1 answer
  • Which scenario describes unethical lab behavior?
    9·1 answer
  • What are the steps to creating a blank database? Use the drop-down menus to complete them.
    9·1 answer
  • Puter Science (IS)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!