# Assignment 1 - Question 4

Posted by MarkF
Announcements Last Post
SoC Curricula 09/30/2017 01:08PM
Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
School of Computing Short Learning Programmes 11/24/2014 08:37AM
Unisa contact information 07/28/2011 01:28PM
 Assignment 1 - Question 4 March 24, 2006 09:26AM IP/Host: 169.202.5.--- Registered: 13 years ago Posts: 3 Rating: 0
Question 4 for assignment 1 has us finding the minimum and maximum values in a list, no problems there, but it also states:

"If the list contains more than n elements, an error message Ã¢â‚¬Ëœlist is too longÃ¢â‚¬â„¢ should be displayed."

Now, there is no reference to this "n" anywhere else, so for me it can only be another parameter. That is, the form will be something like:

find_min_and_max(L, Min, Max, N)

with L being the list, Min the minimum, Max the maximum, and N the value for "n".

This extra parameter just doesn't feel right to me. It seems a clumsy, contrived addition just to have a value for "n".

So, I feel there must be something missing here, something that makes the value of "n" more meaningful.

Any thoughts on this? I'm going with this for now, but I would really like to change it, if somebody could come up with a better idea. Thanks for your time.

 Anonymous User Re: Assignment 1 - Question 4 March 24, 2006 10:40AM IP/Host: ---.gprs.vodacom.co.za Rating: 0
ignore n Its a typing mistake
 Re: Assignment 1 - Question 4 March 28, 2006 08:59PM IP/Host: ---.saix.net Registered: 13 years ago Posts: 1 Rating: 0
Hello there,

How about treating N as a constant and just assign it some reasonable value to limit the maximum number of elements that may be in the list?

It's perhaps still a bit artificial but it doesn't make sense for the CALLER of the procedure to supply the maximum (?)

Regards,
Julian.
Sorry, only registered users may post in this forum.