• YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page

2007 HSC query (1 Viewer)

crammy90

Member
Joined
Mar 26, 2006
Messages
264
Gender
Male
HSC
2008
just did the paper then
for 22 we have to justify a data type for the array
  • i said an array as data type string. Is that the same entirely as the answers' array of strings?
  • 23 i had no idea what that algorithm was doing? did any1 find these questions difficult lol. especially bi, ii, iii and c lol.
  • for di) outline the steps a programmer should take prior to coding this module for use in a SW app, their answers had use live test data and test of systems etc like system testing stuff. Wouldnt u do this after youve wrote the module and not before? how can u test pseudo code on a system :S

i dont see how 8 can be b and not a
how 11 is b and not a
for 17 does the .value inply its a flag or somethin? cuz i had b
and can u do a binary search on a descending list?
 
Last edited:

zvyx

Member
Joined
Aug 10, 2006
Messages
95
Location
NSW
Gender
Male
HSC
2008
array as data type string = array of data type string (thats what I write in exams) = array of strings.

can't answer, since I haven't done the paper, as to how difficult the question was. However, the question says what the algorithm is trying to achieve:
"The following algorithm is designed to check the numbers from 2 to 100, and either print that the number is prime, or print out the number’s factors."

i is the number, isprime is a boolean saying whether or not the number is prime.

In the sub CheckPrime, the crux of it is:

IF mod(i, j) <> 0 THEN
j = j + 1
ELSE
isprime = FALSE
ENDIF

mod is a function that returns the remainder when a number is divided by another. In this case it's particularly useful, since if mod(i,j) returns 0, the number isn't a prime. Theres not much else to explain here. So the subprogram just keeps cross checking for numbers that can divide evenly into the target number. If there aren't any, then the number is a prime.


I don't see a part d in question 23, sorry.
 

crammy90

Member
Joined
Mar 26, 2006
Messages
264
Gender
Male
HSC
2008
apparently its an arc examination 2007 sample :S i didnt see that before aha
its got this hard question in it no idea lol
but then again if its not a legit HSC the algorithms may not be as strightforward or have errors or seomthing.
my teacher printed it off for me
i shall do the actual 2007 one tomorow lol
and thanks for the help with the array of strings :)
i wasnt sure. And an array of characters is just a string yeh?
so in an array of strings there would be an index for each string in this array, and then another set of indexes for each character within the string?....which is in the array of strings aha confusing?
 

zvyx

Member
Joined
Aug 10, 2006
Messages
95
Location
NSW
Gender
Male
HSC
2008
ah.. i see. woops :p

a string can be considered as an array of characters.
in practice, many programming languages don't let you access characters like you would an array - i.e. with an index. (btw, plural of index is indices :p)

try not to complicate matters by thinking that an array of strings = an array of an array of characters; just think of it as an array of strings and you'll be fine :)
 

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

Top