SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
Need answer in C#
Concept Summary:
Recursion
For this assignment1 you will design a recursive method and the main program that calls the
recursive method.
1. This assignment has been adapted from the Roger Frank collection.
Description
Take a piece of paper and fold it in half. Unfold it and there is one fold, which I'll signify with a
"v". If you fold the paper twice (always keeping the folds in the same direction and the creases
parallel), it will have three folds when you unfold it, and they will be in a "^ v v" pattern. Fold a
piece of paper three times, and you will see "^ ^ v v ^ v v" as the sequence of folds.
Folding a piece of already folded paper sounds a lot like recursion, and indeed it is. In case you
can't see the algorithm, here it is:
If you fold a paper once, the fold pattern is "v".
For additional folds, it is the pattern you have only reversed and flipped over, then a "v"
fold, and then the pattern you already have tacked on the end.
Assignment:
Write a helper method reverse which takes in a string and returns the string backwards. For
example, if given Hello, it will return olleH
Hints (you dont have to use these, but they may be helpful):
You can convert a string to an array of characters using (Java)
string.toCharArray() or (C#) string.ToCharArray();
Once you have an array of characters, you can reverse them pretty
easily.
You can convert an array of characters back to a string with (Java)
String x=new String(charArray) or (C#) string x = new
string(charArray);
You may use a loop or recursion for this method.
Write a helper method which converts all ^ to v and all v to ^ in a string. It should take in and
return a string.
Hint: You may find (Java) string.replace() or (C#) String.Replace() useful. Write a static
method, paperFold, which is a recursive routine that returns a string
representing the fold pattern for a paper folded n times. The driver program will call the
paperFold method
As in many recursive solutions, expect the paperFold method to be extremely simple (and of
course recursive).
Main method in Java:
} }
Main method in C#:
}
Sample Output:
Submission Guidelines:
Youll submit one class on gradescope as Assignment 5. Please follow the posted submission
guidelines here:

Contenu connexe

Similaire à Need answer in C#Concept SummaryRecursionFor this assignmen.pdf

Built in classes in java
Built in classes in javaBuilt in classes in java
Built in classes in javaMahmoud Ali
 
Intro To Formula Project
Intro To Formula ProjectIntro To Formula Project
Intro To Formula ProjectKathy Favazza
 
Recursion.pptx
Recursion.pptxRecursion.pptx
Recursion.pptxVijalJain3
 
QUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docx
QUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docxQUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docx
QUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docxamrit47
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsmarangburu42
 
Real World Haskell: Lecture 4
Real World Haskell: Lecture 4Real World Haskell: Lecture 4
Real World Haskell: Lecture 4Bryan O'Sullivan
 
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in PythonSujith Kumar
 
Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Roy Zimmer
 
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular ExpressionMasudul Haque
 
[컴퓨터비전과 인공지능] 6. 역전파 1
[컴퓨터비전과 인공지능] 6. 역전파 1[컴퓨터비전과 인공지능] 6. 역전파 1
[컴퓨터비전과 인공지능] 6. 역전파 1jdo
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular ExpressionsMukesh Tekwani
 
Differential Equations Presention powert point presentation
Differential Equations Presention powert point presentationDifferential Equations Presention powert point presentation
Differential Equations Presention powert point presentationZubairAnwaar
 

Similaire à Need answer in C#Concept SummaryRecursionFor this assignmen.pdf (20)

Built in classes in java
Built in classes in javaBuilt in classes in java
Built in classes in java
 
Intro To Formula Project
Intro To Formula ProjectIntro To Formula Project
Intro To Formula Project
 
Recursion.pptx
Recursion.pptxRecursion.pptx
Recursion.pptx
 
QUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docx
QUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docxQUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docx
QUE 2Measuring Area of Irregular ShapesGeneral formulaThe gene.docx
 
Karnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuitsKarnaugh mapping allaboutcircuits
Karnaugh mapping allaboutcircuits
 
Built-in Classes in JAVA
Built-in Classes in JAVABuilt-in Classes in JAVA
Built-in Classes in JAVA
 
Real World Haskell: Lecture 4
Real World Haskell: Lecture 4Real World Haskell: Lecture 4
Real World Haskell: Lecture 4
 
scalar.pdf
scalar.pdfscalar.pdf
scalar.pdf
 
Derivative rules.docx
Derivative rules.docxDerivative rules.docx
Derivative rules.docx
 
L4
L4L4
L4
 
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in Python
 
Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)
 
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular Expression
 
Get Fast C++ Homework Help
Get Fast C++ Homework HelpGet Fast C++ Homework Help
Get Fast C++ Homework Help
 
[컴퓨터비전과 인공지능] 6. 역전파 1
[컴퓨터비전과 인공지능] 6. 역전파 1[컴퓨터비전과 인공지능] 6. 역전파 1
[컴퓨터비전과 인공지능] 6. 역전파 1
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular Expressions
 
DiffEqPresent.ppt
DiffEqPresent.pptDiffEqPresent.ppt
DiffEqPresent.ppt
 
DiffEqPresent.ppt
DiffEqPresent.pptDiffEqPresent.ppt
DiffEqPresent.ppt
 
DiffEqPresent.ppt
DiffEqPresent.pptDiffEqPresent.ppt
DiffEqPresent.ppt
 
Differential Equations Presention powert point presentation
Differential Equations Presention powert point presentationDifferential Equations Presention powert point presentation
Differential Equations Presention powert point presentation
 

Plus de mkagarwalma

OLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdf
OLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdfOLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdf
OLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdfmkagarwalma
 
Need help with this assignment Sara Lange, a charge nurse at Sunny N.pdf
Need help with this assignment Sara Lange, a charge nurse at Sunny N.pdfNeed help with this assignment Sara Lange, a charge nurse at Sunny N.pdf
Need help with this assignment Sara Lange, a charge nurse at Sunny N.pdfmkagarwalma
 
Obtuviste un contrato para producir 1000 widgets para el gobierno de.pdf
Obtuviste un contrato para producir 1000 widgets para el gobierno de.pdfObtuviste un contrato para producir 1000 widgets para el gobierno de.pdf
Obtuviste un contrato para producir 1000 widgets para el gobierno de.pdfmkagarwalma
 
Observation First-year biology students at the University of Guyana.pdf
Observation First-year biology students at the University of Guyana.pdfObservation First-year biology students at the University of Guyana.pdf
Observation First-year biology students at the University of Guyana.pdfmkagarwalma
 
NSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdf
NSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdfNSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdf
NSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdfmkagarwalma
 
Now that Hurd has more specifically located the source of the econom.pdf
Now that Hurd has more specifically located the source of the econom.pdfNow that Hurd has more specifically located the source of the econom.pdf
Now that Hurd has more specifically located the source of the econom.pdfmkagarwalma
 
Nogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdf
Nogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdfNogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdf
Nogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdfmkagarwalma
 
Need Answer on Urgent Base PleaseUnderstand how technology is used.pdf
Need Answer on Urgent Base PleaseUnderstand how technology is used.pdfNeed Answer on Urgent Base PleaseUnderstand how technology is used.pdf
Need Answer on Urgent Base PleaseUnderstand how technology is used.pdfmkagarwalma
 
NEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdf
NEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdfNEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdf
NEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdfmkagarwalma
 
Need Answer on Urgent Base PleaseUnderstand the different types of.pdf
Need Answer on Urgent Base PleaseUnderstand the different types of.pdfNeed Answer on Urgent Base PleaseUnderstand the different types of.pdf
Need Answer on Urgent Base PleaseUnderstand the different types of.pdfmkagarwalma
 
Need Answer on Urgent Base PleaseUnderstand the drivers and influe.pdf
Need Answer on Urgent Base PleaseUnderstand the drivers and influe.pdfNeed Answer on Urgent Base PleaseUnderstand the drivers and influe.pdf
Need Answer on Urgent Base PleaseUnderstand the drivers and influe.pdfmkagarwalma
 
Nancy had an accident that resulted in injuries to three people. The.pdf
Nancy had an accident that resulted in injuries to three people. The.pdfNancy had an accident that resulted in injuries to three people. The.pdf
Nancy had an accident that resulted in injuries to three people. The.pdfmkagarwalma
 
Nakamura, CPA, has accepted an engagement to audit the financial sta.pdf
Nakamura, CPA, has accepted an engagement to audit the financial sta.pdfNakamura, CPA, has accepted an engagement to audit the financial sta.pdf
Nakamura, CPA, has accepted an engagement to audit the financial sta.pdfmkagarwalma
 
Mountain Co. Ltd. is a small public company limited by shares formed.pdf
Mountain Co. Ltd. is a small public company limited by shares formed.pdfMountain Co. Ltd. is a small public company limited by shares formed.pdf
Mountain Co. Ltd. is a small public company limited by shares formed.pdfmkagarwalma
 
More than a year into the COVID-19 pandemic, the world continues the.pdf
More than a year into the COVID-19 pandemic, the world continues the.pdfMore than a year into the COVID-19 pandemic, the world continues the.pdf
More than a year into the COVID-19 pandemic, the world continues the.pdfmkagarwalma
 
Monique is a life insurance agent in a small company in Ontario. Rec.pdf
Monique is a life insurance agent in a small company in Ontario. Rec.pdfMonique is a life insurance agent in a small company in Ontario. Rec.pdf
Monique is a life insurance agent in a small company in Ontario. Rec.pdfmkagarwalma
 
Mesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdf
Mesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdfMesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdf
Mesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdfmkagarwalma
 
Miguel contributed substantially appreciated property to the MR Part.pdf
Miguel contributed substantially appreciated property to the MR Part.pdfMiguel contributed substantially appreciated property to the MR Part.pdf
Miguel contributed substantially appreciated property to the MR Part.pdfmkagarwalma
 
Mia will retire 10 years from now and wants to establish a fund toda.pdf
Mia will retire 10 years from now and wants to establish a fund toda.pdfMia will retire 10 years from now and wants to establish a fund toda.pdf
Mia will retire 10 years from now and wants to establish a fund toda.pdfmkagarwalma
 
Michael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdf
Michael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdfMichael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdf
Michael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdfmkagarwalma
 

Plus de mkagarwalma (20)

OLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdf
OLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdfOLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdf
OLS modelinde, �rneklem b�y�kl�� (N) arttk�a var( b1 ) ne olur o .pdf
 
Need help with this assignment Sara Lange, a charge nurse at Sunny N.pdf
Need help with this assignment Sara Lange, a charge nurse at Sunny N.pdfNeed help with this assignment Sara Lange, a charge nurse at Sunny N.pdf
Need help with this assignment Sara Lange, a charge nurse at Sunny N.pdf
 
Obtuviste un contrato para producir 1000 widgets para el gobierno de.pdf
Obtuviste un contrato para producir 1000 widgets para el gobierno de.pdfObtuviste un contrato para producir 1000 widgets para el gobierno de.pdf
Obtuviste un contrato para producir 1000 widgets para el gobierno de.pdf
 
Observation First-year biology students at the University of Guyana.pdf
Observation First-year biology students at the University of Guyana.pdfObservation First-year biology students at the University of Guyana.pdf
Observation First-year biology students at the University of Guyana.pdf
 
NSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdf
NSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdfNSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdf
NSZ Ltd. has equity of 15 Million and 10 debt of 20 Million. Cost o.pdf
 
Now that Hurd has more specifically located the source of the econom.pdf
Now that Hurd has more specifically located the source of the econom.pdfNow that Hurd has more specifically located the source of the econom.pdf
Now that Hurd has more specifically located the source of the econom.pdf
 
Nogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdf
Nogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdfNogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdf
Nogalesin bir ksm Amerika Birleik Devletlerinde, Arizonada, dier .pdf
 
Need Answer on Urgent Base PleaseUnderstand how technology is used.pdf
Need Answer on Urgent Base PleaseUnderstand how technology is used.pdfNeed Answer on Urgent Base PleaseUnderstand how technology is used.pdf
Need Answer on Urgent Base PleaseUnderstand how technology is used.pdf
 
NEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdf
NEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdfNEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdf
NEED HELP ASAP!!! doLikeTweet This function is used to add a like .pdf
 
Need Answer on Urgent Base PleaseUnderstand the different types of.pdf
Need Answer on Urgent Base PleaseUnderstand the different types of.pdfNeed Answer on Urgent Base PleaseUnderstand the different types of.pdf
Need Answer on Urgent Base PleaseUnderstand the different types of.pdf
 
Need Answer on Urgent Base PleaseUnderstand the drivers and influe.pdf
Need Answer on Urgent Base PleaseUnderstand the drivers and influe.pdfNeed Answer on Urgent Base PleaseUnderstand the drivers and influe.pdf
Need Answer on Urgent Base PleaseUnderstand the drivers and influe.pdf
 
Nancy had an accident that resulted in injuries to three people. The.pdf
Nancy had an accident that resulted in injuries to three people. The.pdfNancy had an accident that resulted in injuries to three people. The.pdf
Nancy had an accident that resulted in injuries to three people. The.pdf
 
Nakamura, CPA, has accepted an engagement to audit the financial sta.pdf
Nakamura, CPA, has accepted an engagement to audit the financial sta.pdfNakamura, CPA, has accepted an engagement to audit the financial sta.pdf
Nakamura, CPA, has accepted an engagement to audit the financial sta.pdf
 
Mountain Co. Ltd. is a small public company limited by shares formed.pdf
Mountain Co. Ltd. is a small public company limited by shares formed.pdfMountain Co. Ltd. is a small public company limited by shares formed.pdf
Mountain Co. Ltd. is a small public company limited by shares formed.pdf
 
More than a year into the COVID-19 pandemic, the world continues the.pdf
More than a year into the COVID-19 pandemic, the world continues the.pdfMore than a year into the COVID-19 pandemic, the world continues the.pdf
More than a year into the COVID-19 pandemic, the world continues the.pdf
 
Monique is a life insurance agent in a small company in Ontario. Rec.pdf
Monique is a life insurance agent in a small company in Ontario. Rec.pdfMonique is a life insurance agent in a small company in Ontario. Rec.pdf
Monique is a life insurance agent in a small company in Ontario. Rec.pdf
 
Mesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdf
Mesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdfMesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdf
Mesajnz �slup ve �slup a�sndan deerlendirdikten sonra aadakilerden h.pdf
 
Miguel contributed substantially appreciated property to the MR Part.pdf
Miguel contributed substantially appreciated property to the MR Part.pdfMiguel contributed substantially appreciated property to the MR Part.pdf
Miguel contributed substantially appreciated property to the MR Part.pdf
 
Mia will retire 10 years from now and wants to establish a fund toda.pdf
Mia will retire 10 years from now and wants to establish a fund toda.pdfMia will retire 10 years from now and wants to establish a fund toda.pdf
Mia will retire 10 years from now and wants to establish a fund toda.pdf
 
Michael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdf
Michael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdfMichael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdf
Michael McCain Tweeting on the Maple Leaf Foods AccountOn January.pdf
 

Dernier

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Dernier (20)

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Need answer in C#Concept SummaryRecursionFor this assignmen.pdf

  • 1. Need answer in C# Concept Summary: Recursion For this assignment1 you will design a recursive method and the main program that calls the recursive method. 1. This assignment has been adapted from the Roger Frank collection. Description Take a piece of paper and fold it in half. Unfold it and there is one fold, which I'll signify with a "v". If you fold the paper twice (always keeping the folds in the same direction and the creases parallel), it will have three folds when you unfold it, and they will be in a "^ v v" pattern. Fold a piece of paper three times, and you will see "^ ^ v v ^ v v" as the sequence of folds. Folding a piece of already folded paper sounds a lot like recursion, and indeed it is. In case you can't see the algorithm, here it is: If you fold a paper once, the fold pattern is "v". For additional folds, it is the pattern you have only reversed and flipped over, then a "v" fold, and then the pattern you already have tacked on the end. Assignment: Write a helper method reverse which takes in a string and returns the string backwards. For example, if given Hello, it will return olleH Hints (you dont have to use these, but they may be helpful): You can convert a string to an array of characters using (Java) string.toCharArray() or (C#) string.ToCharArray(); Once you have an array of characters, you can reverse them pretty easily. You can convert an array of characters back to a string with (Java) String x=new String(charArray) or (C#) string x = new string(charArray); You may use a loop or recursion for this method. Write a helper method which converts all ^ to v and all v to ^ in a string. It should take in and return a string. Hint: You may find (Java) string.replace() or (C#) String.Replace() useful. Write a static method, paperFold, which is a recursive routine that returns a string representing the fold pattern for a paper folded n times. The driver program will call the paperFold method
  • 2. As in many recursive solutions, expect the paperFold method to be extremely simple (and of course recursive). Main method in Java: } } Main method in C#: } Sample Output: Submission Guidelines: Youll submit one class on gradescope as Assignment 5. Please follow the posted submission guidelines here: