Starting from:

$35

CS3358 - Assignment 5  Solved

Programming
Recursion
Due Date : Section 0 - Wednesday April 9th , 2018 - No Later than 2:15 pm 
Section 1- Wednesday April 9h , 2018 - No Later than 3:45 pm. 
Section 2 - Wednesday April 9th , 2018 - No Later than 5:15 pm.
Write a C++ program that does the following :
1.    Accepts array size from the keyboard. Size must be a positive integer that is >= 10 and <= 1000.
2.    Use the size from step 1 in order to create an integer array. Populate the created array with random integer values between 10 and 1000 inclusive
3.    Display the first 10 elements of the generated array.
4.    Write a function that uses recursion in order to display squares of integers in ascending order, starting from 1 to last number in the array.
5.    Write a function that uses recursion to raise a number to a power. The function should take two arguments, the number to be raised to the power is the first number in array and the power is 2.
6.    Write a recursive function that returns the maximum elements in the array
7.    Using quick sort , write a function that uses recursion to sort the array in descending order. Calculate and print the CPU time before each step starts and after each completed step then calculate actual CPU time for the completion of each step. Use the last value as a pivot value.
8.    Write a recursive function that that takes an integer ( first number in the sorted arrays ) as a parameter and returns the sum of digits of that integer.

More products