For next loop ? (1 Viewer)

chris42

Member
Joined
Oct 4, 2003
Messages
649
Location
Sydney
Gender
Male
HSC
2004
Hey,

Does anyone know what the for next loop, looks like and whether we need to know it for the HSC?
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
The syllabus and related support documents are a bit hazy in regard to FOR...NEXT loops.

They could use them in pseudocode in an HSC question, but not on a flowchart. The most likely syntax would be something like...

FOR Counter taking initial value of 1 TO 100 BY steps of 2
...
ENDFOR

or perhaps...

FOR Counter = 1 TO 100 STEP 2
...
NEXT Counter

or some other permutation of the above.

HTH
Sam
 

chris42

Member
Joined
Oct 4, 2003
Messages
649
Location
Sydney
Gender
Male
HSC
2004
Thanks for that SamD, I never really covered for next loops in my notes.
 

fatmuscle

Active Member
Joined
Jul 6, 2002
Messages
3,707
Location
Hornsby
Gender
Male
HSC
2001
FOR ( i = 1; i < 10; i++)
some process
<END FOR>

i think...

actual code will look something like this (in C)

for(i=1; tempString!='\0'; i++)
{
...tempString = tempString[0];
}
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
From memory counting loops in pseudocode are covered in the Prelim SDD course not specifically in the HSC course. This, of course, means they can be examined in the HSC but the chances would tend to be less likely.

Fatmuscle: That's code NOT pseudocode, the markers may have a spack if you used that!!!

However, it is the logic of your algorithms that is being tested, so don't get too bogged down on the detailed syntax of pseudocode or flowcharts. If your algortihm works, is well structured and can be understood then you win the marks. If it doesn't work but you've used nice pseudocode syntax you could be lucky and get a mark. It's a case of something being better than nothing!

HTH
Sam
 

-X-

Member
Joined
Aug 10, 2003
Messages
481
Gender
Undisclosed
HSC
N/A
SamD, do teachers actually examine your WHOLE algorithm to check if the logic is correct? Or do they just look for key parts i.e. "a decrementing loop", "an if statement to check for so n so...." etc...? If they checked for the logic, it would be a pain especially if there are millions of ways to solving a problem. For example, one persons algorithm might be 5 lines while mine = 25 lines but both do the same thing.
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
Yep the total logic is checked. Mind you it gets pretty quick once you've seen a few hundred algorithms all answering the identical question. There really are not that many different ways used to solve most problems, and its exciting when you get a new one (well at least it relieves the boredom).

Sam
 

-X-

Member
Joined
Aug 10, 2003
Messages
481
Gender
Undisclosed
HSC
N/A
hmm ok then. I asked cause my teacher said they only mark using the marking criteria ie if theres a loop, 1 mark, if the loop can actually end, another mark etc... Better put more effort into it then.

Thanks :)

edit: Teacher did say the basic logic must be there though, not just chucking loops everywere :p except that it dooesn't have to be perfect.
 
Last edited:

Fosweb

I could be your Doctor...
Joined
Jun 20, 2003
Messages
594
Location
UNSW. Still.
Gender
Male
HSC
2003
Elegance...
Do it elegantly and they will be happy, and you will get 'marker is happy' marks (hehe) (i wish)
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
-X-: Correct, the marking criteria is used quite rigidly, however it is never so rigid that correct answers lose marks. Also if for example the criteria says a mark is awarded for a loop then it is understood that the loop must be used in the correct context and work correctly. You can't just shove a loop in anywhere and get the mark.

It is true that for algorithm questions there will be some solutions that are a bit obtuse, but still correct, this is one of the roles of the senior markers, they ensure such solutions are marked fairly even if they don't fit the marking criteria.

Fosweb: When I was a senior marker for 3U we had many discussions about awarding marks for elegant solutions. Actually they were more like arguments, its not easy to define elegance in such a way that 30 or so markers will interpret it fairly!

The best way for you guys to help the markers is to just get all your algorithms completely correct, simple really!!!!
 

-X-

Member
Joined
Aug 10, 2003
Messages
481
Gender
Undisclosed
HSC
N/A
however it is never so rigid that correct answers lose marks.
Thanks SamD!!
I was worried that sometimes, im sure my algorithm is correct but it could be difficult for someone else to understand it with out actually spending a heap of time on it or testing it on a computer. lol. :D
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top