I need help getting started here. I am having a wicked brain block. I don't know if the wording is confusing me or what. This is my first experience with arrays.
write a program that takes an array (of any size) of float and
prints its contents to the nearest integer. The rounding should be totally programmed
by you (don't use any C++ special libraries for this).
Write two functions in addition to main:
int roundIt (float x)
which would round any float to the nearest int, and return the int value
and
void print_integers(float a [ ], int size)
which would print/display the contents of array of size size a rounded to the nearest
int.
Your main function could call print_integers, and print_integers would call roundIt
for every element of the array, and print the rounded value.
This is pointing me in an amazing direction, thank you. Now I am just trying to try to figure out how to get input from the keyboard rather from giving it its parameters.
is there a way to ask for any size of an array? I know that is usually done as a parameter to a function - like the part above - when I print this version, it was also printing the 10. If I leave the braces empty, it makes the MAX undefined....