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
iragen [17]
1 year ago
4

write a recursive method that takes a string as a parameter. it returns a string composed of itself, and a mirror image of itsel

f(reverse), separated by a hyphen. complete this function without the aid of a helper function and without the usage of the string classes reverse method.
Computers and Technology
1 answer:
ser-zykov [4K]1 year ago
7 0

You can use the code below to solve the question about recursive methods:

-------------------

CODE AREA

-------------------

#include <iostream>

using namespace std;

string mirrorString(string s){

if(s.length()==1)return s;

   string word=s.at(s.length()-1)+mirrorString(s.substr(0,s.length()-1));

   return word;

}

int main()

{

 

cout << mirrorString("rahul")<< endl;

cout << mirrorString("Kumar")<< endl;

cout << mirrorString("Chegg")<< endl;

cout << mirrorString("Kundra")<< endl;

  return 0;

}

-------------------

CODE AREA

-------------------

Learn more about recursive method: brainly.com/question/22237421

#SPJ4

The Output:

You might be interested in
Is a trade group that promotes wireless technology and owns the trademark for the term “wi-fi”
ivann1987 [24]

Answer:

1. Wifi Alliance

2. Cells

Hope this helps! Have a great day! :)

7 0
4 years ago
Read 2 more answers
Place Letter or word in correct section where it says labels bellow
love history [14]
A beauty its not b c or d
3 0
3 years ago
Read 2 more answers
Tina has made a database table in access containing field name class roll number and contact number she has set primary key for
Andrej [43]

Answer:

the answer is B for plato users

Explanation:

5 0
3 years ago
Do the pros of interpersonal communication via social media outweigh the cons? Explain.
JulijaS [17]
Well in my opinion is that yes they do. The ability to be able to communicate with others so far way really helps society advance towards the future. And i cant stress of how the benefits of being able to share ideas with well anyone is so wonderful.

I hope this helps.
6 0
3 years ago
Read 2 more answers
rite a program to perform time conversion. The user will select from the following menu: Hours to minutes Days to hours Minutes
Vinvika [58]

Answer:

import java.util.Scanner;

public class TimeConversion

{

public static void main(String[] args) {

   

    Scanner input = new Scanner(System.in);

           

       System.out.print("1. Hours to minutes\n2. Days to hours\n3. Minutes to hours\n4. Hours to days\n");

       System.out.print("Enter your choice:");

       int choice = input.nextInt();

       

       switch(choice) {

           case 1:

               System.out.print("Enter the number of hours:");

               int hour = input.nextInt();

               System.out.println("There are "+ hour*60 + " minutes in " + hour + " hours");

               break;

           case 2:

               System.out.print("Enter the number of days:");

               int day = input.nextInt();

               System.out.println("There are "+ day*24 + " hours in " + day + " days");

               break;

           case 3:

               System.out.print("Enter the number of minutes:");

               int minute = input.nextInt();

               System.out.println("There are "+ minute/60 + " hours in " + minute + " minutes");

               break;

           case 4:

               System.out.print("Enter the number of hours:");

               int h = input.nextInt();

               System.out.println("There are "+ h/24 + " days in " + h + " hours");

               break;

           default:

               System.out.println("Invalid Input!");

       }

}

}

Explanation:

- Print the menu

- Ask the user to choose one of the options

- Depending on the choice, use switch-case statement to calculate and print required conversion

- Print an error message if the user enters a number that is not in the menu

7 0
3 years ago
Other questions:
  • What are the advantages and disadvantages of using thermoset plastics
    14·1 answer
  • Explain the design and development proccess?
    15·1 answer
  • Assume that the system has a multiple level queue with a variable time quantum per queue, and that the incoming job needs 80 ms
    14·1 answer
  • A university wants to install a client-server network. Which feature do you think is important for them as they set up the netwo
    8·1 answer
  • Cómo pongo un tomo de llamada SIN PAGAR?
    7·1 answer
  • Xavier buys a new laptop for $540. He makes a down payment $75 and pays the rest in 6 equal monthly payments, p. What equation r
    7·1 answer
  • My brainly has broke- XD
    11·1 answer
  • A letter of application should be written on:
    13·1 answer
  • Project: Big Data Programming - Section 2
    11·1 answer
  • You're on the lead generation team at a wine reseller called Partners in Wine. You've noticed that the user open rate of your em
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!