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
In the context of organizational decisions at the tactical management level, _____ decisions are often used in resolving conflic
natali 33 [55]

Answer:

b. structured

Explanation:

Based on the information being described within the question it can be said that the type of decisions being mentioned are known as structured decisions. These are decisions which have various processes in place in order to handle a certain situation. Usually due to the problem having occurred countless times and are predictable.

4 0
3 years ago
The movement of the economy through highs and lows is referred to as:
skad [1K]

Answer:

the business cycle

Explanation:

5 0
3 years ago
PLEASE HELP ME!!!!
White raven [17]
The answers are D and A
5 0
3 years ago
Read 2 more answers
PLEASE SOMEONE ANSWER THIS
maw [93]
Maybe 7411 or someones birthday in the family
3 0
3 years ago
Read 2 more answers
Assume that grade is a variable whose value is a letter grade-- any one of the following letters: 'A', 'B', 'C', 'D', 'E', 'F',
d1i1m1o1n [39]

Answer:

switch (grade) {

 case 'A':

   acount++;

   break;

 case 'B':

   bcount++;

   break;

 case 'C':

   ccount++;

   break;

 case 'D':

   dcount++;

   break;

 case 'E':

   ecount++;

   break;

 case 'F':

   fcount++;

   break;

 case 'W':

   wcount++;

   break;

 case 'I':

   icount++;

   break;

}

Explanation:

6 0
4 years ago
Other questions:
  • A/An ___ is a series of instructions or commands that computer follows used to create software
    10·2 answers
  • Help me out for this one
    12·1 answer
  • Write a program to calculate how much to tip a waiter person based on the quality of service. The script file should ask for the
    12·1 answer
  • Public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -&gt; System.out.println(nam
    12·1 answer
  • When you take action independent of direct instruction, you are showing _____.
    11·1 answer
  • A user tells a help desk technician that their browser is displaying a message that a site can't be
    14·1 answer
  • An alternative to configuring individual workstations is to establish configurations dynamically when the computers connect to t
    7·1 answer
  • Create a SELECT statement that returns the count, average, max and min of the invoices submitted by each vendor, who has submitt
    8·1 answer
  • Koi jinda hei kya hello​
    13·2 answers
  • Which of these statements performs real number quotient division using type casting?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!