It's UWAweek 26 (mid-year break)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented Programming.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 257 articles.
Currently 10 other people reading this forum.


 UWA week 20 (1st semester, week 11) ↓
SVG not supported

Login to reply

👍?
helpful
1:41pm Wed 15th May, Andrew G.

"Hugo Smith" <23*2*1*2@s*u*e*t*u*a*e*u*a*> wrote:
> Hi Goz and Max, > > Just a quick query about how we implement our filtering iterator. The way I've implemented mine, the first valid next element is found when the iterator is constructed, would this be penalised? I know we shouldn't load in all of the elements but I'm unsure whether preloading one element would cost marks > > Thanks in advance
By the specification, you should not preload the first element on construction, as it says you should consume elements from the iterator only as required. If I call your filter method and then do not use the returned iterator, there was no reason for it to consume anything from the given iterator. Having said that, the instructions and marking rubric are very clear. You get the mark so long as you pass the test, with exception of the warning. The warning says that if we have reason to believe that you have written your code only so as to pass the tests and not as a general solution, you may not receive a mark as you will not have actually made a valid submission. The warning does not apply here, as this is not an attempt to circumvent the tests. However do note the style mark for "logical and elegant" solutions. I cannot say without marking your code, but I could believe that if your solution is consuming elements when it does not need to it may not get this mark. So ultimately, since you have recognized that your current solution consumes an element unnecessarily, I would encourage you to find a better way. If you are unable to, however, do not worry overly, as you will still get the mark for passing the test, and there is no guarantee that you will not get the style mark. This is a case where I did not think to make the tests stricter, as I did not think of this alternative implementation. But that does not change what the tests are and what the marking rubric says. Gozz

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy