Question: Write a C + + program with multiple functions that reads an array of type int and prints the number of negative numbers in an

Write a C++ program with multiple functions that reads an array of type int and prints the number of negative numbers in an array. The must have six entries in an array. The description of the functions are:
One function to collect a number from -5 to 5, inclusive, and return the number. The function returns only a number between -5 and 5, otherwise, it will keep asking the user to enter a valid number.
One function to collect up to 6 numbers. Name this function num_array(). Each number must be between -5 and 5 inclusive, which is collected using the previous function. The numbers must be saved in an array.
One function to count and return the total number of negative numbers in an array. Hint: this function should go over the array created from the previous function.
One function to print all the six numbers saved in an array as
___,___,___,____,____,____
One function to prompt the result as
There are ____ negative numbers!
The main() function only has the following lines:int main(f
int array_size =6, n;
int numbers [array_sizel;
num_array (numbers, array_size); print_num(numbers, array_size);
n = neg_num (numbers, array_size);
prompt_result(n) ;
return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!