Tuesday, July 28, 2009

Textbook error?? Help??

This is some stuff I am working on for a practice assignment I have for the first week of my class, the syntax is done in C++, fyi.





3.Consider the function headings:





void funcOne(int alpha[], int size);


Int funcSum(int x, int y);


Void funcTwo(const int alpha[],int beta[]);





And the declarations





Int list[50];


Int Alist[60];


Int num;





Write C++ satments that do the following:





a.Call the function funcOne with the actual parameters, list and 50 respectively.


funcOne(alpha[],size,list[]);





b.Print the value returned by the function funcSum with the actual parameters, 50 and the fourth component of list, respectively.





Ok, now this is what I have a question on, the words on question b..."Print the value returned by the function funcSum", the last time I checked, you can return any value you want as long as it was the same data type AS the function, I could return 0,1,x,y, heck I could return 666 if I wanted, but that is beyond the question. Is it just me...or

Textbook error?? Help??
The question is poorly worded. Chances are, funcSum returns the sum of two values x and y. If you need an answer, x+y would be the best guess, but like you said, there is no real way of knowing.


No comments:

Post a Comment