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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started