Question: Write a recursive function named zigzag that returns a string of n characters as follows. The middle character ( or the middle two characters if

Write a recursive function named zigzag that returns a string of n characters as follows. The middle character (or the middle two characters if n is even) is an asterisk (*). All characters before the asterisks are ?'>. All characters after are >'. Report an error if n is not positive. Ask for the user input to test the code.
Example: n=6, pattern is if n=5 pattern is ?**>>
 Write a recursive function named zigzag that returns a string of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!