Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

Students also viewed these Databases questions