Valhalla Legends Forums Archive | General Programming | HSC Question

AuthorMessageTime
FrOzeN
[code]BEGIN FindDogOwner (req_microchipno, req_ownername)
    found = false
    open (Owner) indexed by microchipno
    read (Owner) microchipno, ownername
    WHILE not found OR not end of file
        IF microchipno = req_microchipno THEN
            req_ownername = ownername
            found = true
        ENDIF
        read (Owner) microchipno, ownername
    ENDWHILE
    IF not found THEN
        print ‘no owner recorded’
    ELSE
        print ‘owner is ’; ownername
    ENDIF
END[/code]

Question: What type of variable is ‘found’?
  (A) A constant
  (B) A flag
  (C) A string
  (D) A trigger

---
Just post either A, B, C or D depending on what you think/know the answer is. I'm going over HSC tests from previous years, and found the answer they said for this one to be different to what I thought. I'll post it after some replies.

Also, HSC stands for "High School Certificate", it's Australian. It would be equivalent to whatever the most important exam you do in High School in America/Canada/etc..
May 23, 2006, 3:00 AM
rabbit
Secret answer E) a boolean variable.
May 23, 2006, 3:05 AM
FrOzeN
Boolean was my first thoughts when reading the question, before seeing the choices. But unfortunately it's not it.
May 23, 2006, 3:43 AM
Topaz
I'd think it was a trigger.
May 23, 2006, 3:47 AM
FrOzeN
The answer I put down was trigger. (I just opened notepad and did the first 20 questions to see what I'd get).

But the HSC says it's a flag? I would of assumed a flag would be a Integer/Long (.. if anything). Can anyone fiqure out why it's a flag?

Question 13 (page 7):
http://www.boardofstudies.nsw.edu.au/hsc_exams/hsc2001exams/pdf_doc/software_design_developm_01.pdf

Answers (page 6):
http://www.boardofstudies.nsw.edu.au/hsc_exams/hsc2001exams/pdf_doc/software_design_dev_er01.pdf
May 23, 2006, 3:54 AM
St0rm.iD
flags are booleans
May 23, 2006, 4:14 AM
FrOzeN
[quote author=Banana fanna fo fanna link=topic=15031.msg153001#msg153001 date=1148357654]
flags are booleans
[/quote]
Oh, ok.

Are triggers anything, or just part of the 'fake' answers?

[EDIT] Note: Anything as in some form of data type, or some programming term.
May 23, 2006, 4:59 AM

Search