PLESE CODE IN C# not java RECURSION Objectives • Learn the basics of recursion – Part II (last...

50.1K

Verified Solution

Question

Programming

PLESE CODE IN C# not java

RECURSION

Objectives

• Learn the basics of recursion – Part II (last week was Part I)Submission Guidelines:

You will turn in 2 program files (one for each lab problem)

Tasks

This lab has two parts:

Write a driver program that calls this method from the Mainprogram.

• •

Write a driver program that calls this method from the Mainprogram.

Note: Your program name should match the name of your java / C#class exactly. e.g Lab10a.java / Lab10a.cs

Sample Output: LAB 1:

//A call to recursive function repeatNTimes(“hello”, 5)hellohellohellohellohello

// A call to recursive function repeatNTimes(“Good morning!”, 3)Good morning!Good morning!Good morning!

LAB 2:

1. Write a recursive method

repeatNTimes(String s, int n) that accepts a String and an

integer as two parameters and returns a string that isconcatenated together n times. (For

example, repeatNTimes (\"hello\", 3) returns\"hellohellohello\")

2. Write a recursive method called isReverse(String s1, Strings2) that accepts two

strings as parameters and returns true if the two stringscontain the same sequence of characters as

each other but in the opposite order and false otherwise.

The recursive function should ignore capitalization. (Forexample, the call of

isReverse(\"hello\", \"eLLoH\") would return true.)

The empty string, as well as any one letter string, should beits own reverse.

  

Page 1 of 2

//Call to recursive function isReverse (\"Computer\",\"retupmCo\")false

//Call to recursive function isReverse (\"Hello\",\"olleh\")true

Answer & Explanation Solved by verified expert
3.7 Ratings (409 Votes)
Here is the completed code for this problem Comments are included go through it learn how things work    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students