Welcome! Log In Create A New Profile

Advanced

Inclusive?

Posted by NicV 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Inclusive?
March 04, 2011 10:46AM
Im having trouble with the phrasing of the questions.

In the assignment, some of the questions say (for example) "must be between 1 and 100 (inclusive)". Does this mean that the answer can be 1 or 100 also? (<= or >=) Or only between 1 - 100? (< or >winking smiley.

I emailed my questions to the lecturers, but am still waiting for answers.
avatar Re: Inclusive?
March 04, 2011 12:31PM
"Inclusive" means "includes". So 1 <= x <= 100.

Careful of that "fencepost error" they talk about, 'ay.
avatar Re: Inclusive?
March 07, 2011 08:58AM
Thanks, I'll remember that. Just think they can word the questions a bit more clearly...
avatar Re: Inclusive?
March 07, 2011 10:08AM
Actually, it's probably a translation error. That's a very common way of talking about lists in English and not specific to programming or mathematical subjects.

If I were to ask you to choose a number between 1 and 100, then by definition, the word 'between' would mean that you would not be allowed to choose 1 or 100. Therefore, the word 'between' implies exclusivity. If I wanted you to be allowed to choose the two boundary numbers as well, then I would have to specify that they must be included in your list of available choices. I would have to change my request to, "Choose a number between 1 and 100, inclusive".
Re: Inclusive?
March 07, 2011 08:30PM
I would say x>= 1 && x <= 100
avatar Re: Inclusive?
March 07, 2011 10:38PM
Bloomin' programmers!!
: - )
As long as you watch the fence posts ...
Sorry, only registered users may post in this forum.

Click here to login