Question: write a function, createArray, that takes an integer parameter and returns a pointer to an array whose size is specified by the function's parameter. Its
write a function, createArray, that takes an integer parameter and returns a pointer to an array whose size is specified by the function's parameter. Its signature is int* createArray(int n).
write a function, resizeArray, that takes a array of one size and changes its size to another size. Its signature is void resizeArray(int * &array, int old_size, int new_size).
write and test a function, generateSquares, that generates an array of the squares of the integers from from 1 to n where n is a positive integer. Its signature is int* generateSquares(int n);
write a function, reverseArray, that reverses the order of the elements of an array. It signature is void reverseArray(int * array, int n);
write a function, partitionSquares that takes an array of squares and distributes the squares among two other arrays so that the sum of the contents of the two arrays equal or as close to equal as possible. Its signature is void partitionSquare(int n, int original[], int * &part1, int * & part2, int & size1, int& size2, int&sum1, int& sum2), where part1 and part2 are arrays of squares, size1 and size2 are the sizes of the squares, and sum1 and sum2 are sums of the contents of the array.
Write a function, showPartition, that displays the partition of the squares. The function's signature is void showPartition(int part1[], int part2[], int size1, int size2, int sum1, int sum2);
Write a program that reads a number n from an input device, partitions the squares of the numbers from 1 to n, and displays the partitions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
