Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following: struct Values { long positive _ values ; long negative _ values ; long even _ values ; long odd _ values

Consider the following:
struct Values {
long positive_values ;
long negative_values ;
long even_values ;
long odd_values ;
} ;
Write a function having the prototype:
Values count_values(long
in_array[], long in_size) ;
where in_array is an array of in_size long values.
The function should traverse the array in_array counting the number of positive values, negative values, even values, and negative values encountered and return a variable of type Values containing the information. (Zero should be considered a positive value).
Consider the following C++ code snippet:
const long SIZE =10 ;
const long THE_ARRAY[SIZE],
10,6,100,-5bar(4),3,9,8,-4,0;
Without writing a full int main () function, write the C++ statements necessary to call the function defined above.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions