Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a program assignment, she wants the program done in the format like the second picture. So just add the correct codes in the

This is a program assignment, she wants the program done in the format like the second picture. So just add the correct codes in the template (2nd picture). Thank you so much! image text in transcribed
image text in transcribed
CSC 260L Laboratory 10 Spring 2018 Some Fun with Recursion Examine the code of recursive functions in Lab10.cpp and see below Write the following two functions in the Lab10.cpp file and run each on the array int arr [10-400, 3, -66, 7, -6, 201, 199, -4, 0, 77 (1) Write a recursive function that prints out the values of and integer element function from index size-1 to 0. EXAMPLE: if the array in the parameter to the function were int al4]- (9, 5, 33, 2), the output would be 2 33 5 9. Name this function as firstlnitialLastNamePrintRecursion (2) Write a value-returned recursive function to return the number of integer array elements that are either 99. (50 points each) Name this function as firstlnitialLast Write a test program (with main)) to test your two functions out. Be sure that your output is self-explained with nice descriptive sentences to show what will be printed out. For example, you can print out the original array first, then you can print out the list by using recursive algorithm, and last you can print out the numbers that are either 99 [Bonus -20 points) Use STL vector as your data structure. Generate any number (random) of element (including positive and negative numbers) to the vector before calling the 2 recursive functions. This must be well documented in order to receive the points. A RECURSIVE FUNCTION is a function that calls itself Example: int fn( int n if(n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions