Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in C follow the instructions of the question please Exercise2 - Array operations using recursive functions (4 marks) Exercise Objectives Identifying the base case(s)

Write in C
follow the instructions of the question please
image text in transcribed
Exercise2 - Array operations using recursive functions (4 marks) Exercise Objectives Identifying the base case(s) and recursive step used for processing arrays recursively Implementing and calling recursive function that receives arrays as parameters Implementing array operations within recursive functions definitions Calling functions Problem Description Within replit.com IDE, create another new repl (project) and name it "Lab10Ex3- your program should perform the following: Use the symbolic constant to define the size of the array, consider the size as even number Declare a 10 array named items of the above size Declare the following functions as prototype and implement them after the main function Readitems(), a recursive function receives an integer array and prompts the user to input all of array elements. (Hint: You can use static variable to keep track with array indices] Printitems(), this recursive function receives an integer array and displays its elements. [Hint: You can use static variable to keep track with array indices] Page 5 of 5 Maxitem(), a recursive function receives an integer array, then returns the max item within array elements. (Note: Don't use math.h functions PrintinReverse(), this recursive function receives an integer array and print array elements in reverse SumArray(), this recursive function receives an integer array, and two integer values representing the start and end of array. This function returns the summation of all elements from start to end. In the main function: Read items by calling Readitems() function Print items using Printitems() function Print the items in reverse by calling PrintinReverse() Find the max element in items array by calling Maxitem() Call SumArray for the two halves of the items array, if both summations are the same then print "This array is Symmetric" Sample Output Reading array elements 8 12 10 5 17 8 Printing array elements 8 12 10 5 17 8 The max item is 17 Printing array elements in reverse 8 17 5 10 8 Sum of the first half = 30 12 Sum of the second half = 30 This array is Symmetric

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions