• Got a question on how to use our new website? Check out our user guide here!

algorithm design help :( (1 Viewer)

Acturial

New Member
Joined
Feb 20, 2012
Messages
19
Gender
Undisclosed
HSC
2014
hi guys,
when writing algorithms... how do we know what to use when we are trying to access something in an array or a file.
for example, for an array of records "SCORES" which has names and relevant scores for each name... if we want to access it in our algorithm do we say SCORES.name?

also, how do we know when to write READ X or GET X ?
 

Shazer2

Member
Joined
Feb 16, 2012
Messages
439
Gender
Male
HSC
2013
I don't think there is one specific way to pseudocode. It should be descriptive and get the intent behind your algorithm across to the marker.
 

hjed

Member
Joined
Nov 10, 2011
Messages
211
Gender
Undisclosed
HSC
2013
indexes always go after the name of the array, so it would be SCORES.name or the same with () brackets.
SCORES.name is a record with an array in it, not an array of record. At least that would be the case in any programming language I've ever used.
I just looked at the course specs for that though and the single instance where they reference a field in a record they do it the way you do it. Considering how inconsistent the actual course specs are for pseduocode as long as they can understand it you should be fine.

For files however there are very specific ways of accessing them in the course specs: http://www.boardofstudies.nsw.edu.au/syllabus_hsc/pdf_doc/software-design-development-course-specs.pdf

READ is from a file, GET is an input that's not a file.
 

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

Top