Question 22 exam thoughts (1 Viewer)

Saintly Devil

Member
Joined
Oct 12, 2002
Messages
107
Originally posted by squ34ki
Cardslot is set as False
so WHILE NOt cardslot
means while there is a card
hmm......i don know..... i think WHILE NOT cardslot means that whilst there isn't a card in the slot. That's the point of READ cardslot being put in a loop - to continually monitor when a card is input.
 

~Perfection

-Funked Up-
Joined
Oct 14, 2003
Messages
326
Location
Lost in Music
Gender
Female
HSC
2003
Originally posted by JRasnier
i actually said line 21 was wrong, validated = true, cause i said that the door would always be validated as true as long as it was switched on....
same 'ere

Originally posted by Fiona
Oh crap.

I thought it was later on when the thing checked to see if the card was there, and then after the IF thing to see if there was a card, there was instructions for what to do.

I thought the error was that in even if there was no card, it was doing the instructions for if there was a card eg. checking the password and stuff.

Hmm... :confused:
yeh, thats what my friend said
 

saves.the.day

Member
Joined
Oct 29, 2003
Messages
233
Location
Castle Hill
Gender
Undisclosed
HSC
2003
Originally posted by psycho_mushy
for the Logic error I sayd

WHILE NOT CardInSlot
READ cardslot

I said this coz it says "while the card is not in slot, read slot" it was I'm assuming logic error so I put that down.... I didn't refer to antyhing after it coz it said logic error and that seemed pretty logical to me
dammit. After reading this ton of posts I realise I am wrong and after reading all these posts, yours seems like the most logical response. This is because
a) its a logic error hehe

But if this is the right answer, then that exam was a total ripoff. Seriously.. the code was flawless except one little thing like that grrr hehehe well enough of my sooking.

Originally posted by mattyb
did you guys ever think that there was no answer? like if it was kinda rhetorical and how u back up your answer and repair the "error" that you discovered that counts?
No

Originally posted by JRasnier
maybe theres more then one error, just want to give ppl a chance.....
Doubt that. As much as I'd like to think so. If you read the marking guidelines for the past 2 years' algorithm desk checking, you can only identify the one problem, or when it specified in last years i think (can't remember off the top of my head if it was last year or 2001) it specified multiple.

But I hope thats right.. gives us a chance lol
 

squ34ki

heavenian woohzaa!
Joined
Aug 26, 2003
Messages
26
Location
Citizen of Heaven
Gender
Undisclosed
HSC
2005
don't worry, its just one question...

but that was a killer, there was so many ways to interpret the error, like ppl said, the error could have been in the validated.
 

Winston

Active Member
Joined
Aug 30, 2002
Messages
6,128
Gender
Undisclosed
HSC
2003
Originally posted by Kn1ght_M4r3
why n0t scan the question up and see wat sam d says?
Why not scan the whole paper and see how Sam will make us all die of misery lol after finding out how wrong we are
 

rushworld

Member
Joined
May 16, 2003
Messages
44
Location
On Cloud 9
Gender
Male
HSC
2003
Was I the only person who found a few logical errors in the algorithm?

1) System_on [Line 2] is never used throughout the code, it's 'Switched_on' [Line 4/20].
2) When the 'WHILE NOT CardInSlot' loop is entered in to it will continually repeat over and over until CardInSolot = TRUE. So in essence this is a logical error because 'Switched_on' can never be turned to FALSE (so the system cannot be turned off) unless you put in a card and bypass the Lines 15-etc crap somehow, perhaps a dummy card?

I'm sure I found some more during the exam I just can't think right now, too tired -_-

EDIT: Okay I read all the other posts, and maybe I'm not the only one... *shrug*
 
Last edited:

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
Here's what I've posted to the Computing Studies Teachers group in regard to 22 (b)(i)...

Hi everyone,

Some comments on 22(b)(ii) in the SDD HSC.

Exam committee members, please take these comments as constructive criticism. I just feel for the students who had to answer this question and for the poor buggers who've got to mark it!

Anyway here's my comments on it...

1. Firstly, just prior to part (ii) the question says "The system has a logic error", the "system" not necessarily the algorithm, although most would assume the logic error is in the algorithm. Then in part (ii) it says "Locate the error...", we assume "THE error" is THE logic error previously referred to, but maybe not! I know this is somewhat pedantic; however maybe it means consideration should be given to awarding marks for locating/correcting any type of error? (Hence my non-logic error comments below).

2. Line 4 is an error (but is it in reality a typo?) still it should be WHILE System_on. There are two possible effects, either you never enter the loop at all (if Switched_on is false) or processing continues infinitely (if Switched_on is True). In either case it results in bodgy processing, so it is a logic error. If this is the intended error then it's pretty trivial for 4 marks, it's a shame it's in the question as many students will have spotted it and just waffled on about it. Surely students will get marks for it... as the question says locate THE error. (Also if you need to READ this value from somewhere at the end of the loop then surely you'd need to READ it before the loop as a priming READ).

3. Line 21 is redundant, but this does not cause a logic error.

4. Line 5 has a space in CustomerNumber. This line is pointless anyway, as the CustomerNumber originates from the AcceptCardDetails call, so not a logic error. Similarly, why is Validated and StoredPassword initialised? The values for all three of these identifiers originate from calls before they are processed at all, hence they dont need to be initialised at all. (When implemented in code you need to declare them but you dont need to initialise them).

5. The mainline does not implement the structure chart correctly. In the pseudocode AcceptMenuChoice is executed in response to a decision based on the value of Validated, yet no decision diamond appears on the structure chart. The structure chart indicates that the Validated control parameter is sent to the AcceptMenuChoice routine, which it is. The implication being that it is used within the AcceptMenuChoice routine to determine if menu choices can indeed be processed. Is this a logic error? It all still works as intended so I guess not, but there is redundant processing. However, the logic in the pseudocode does not match the logic in the structure chart, so in this sense it is a logic error (or at least some sort of error),its better than writing nothing so I'd hope some portion of the marks would be awarded.

6. I suspect this could just be 'THE logic error' the examiners were after, but I'm not a mind reader. Imagine the ATM is turned on (Switched_on or System_on, whatever), execution has now entered the outside loop. CardInSlot is set to FALSE, so we enter the inside loop. The only way you can ever get out of this 'WHILE NOT CardInSlot loop is to shove in a card. So the only way to get the thing to turn off is to switch it off (whatever that means!) then shove a card in the card slot, this gets you out of the 'WHILE NOT CardInSlot' loop, before System_on (or Switched_on) is read as false. This is weird stuff, as it seems logical to assume System_on or Switched_on refers to the power, if you turn the power off then surely everything stops regardless of the algorithm! (Maybe there's a battery, so the current transaction can be completed, who knows!) If this is "THE error" then it's a bit obtuse, I can think of heaps of ways to include a logic error in the algorithm, and this would not be one of them.

So how do kids fix all this mess? Here's one possible solution that, I think, fixes all of the above...
Code:
BEGIN ATM System
  READ System_on
  WHILE System_on
    IF Card is located in cardslot THEN
      AcceptCardDetails(CustomerNumber,StoredPassword)
      AcceptAndValidatePassword(StoredPassword,Validated)
      AcceptMenuChoice(Validated,CustomerNumber)
    ENDIF
    READ System_on
  ENDWHILE
END
Have I missed the intended logic error? If I have then let me know, and then trash this post!

Regards,

Sam

(Kids are asking about this on the Bored of Studies site, so Ill post a copy there also).
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
Hmmm....interesting. Most I didn't pick up.

But did they expect us students to be able to do that?

Pretty bad question. And it was worth 4 marks!
 

True_Monolith07

New Member
Joined
Oct 28, 2003
Messages
5
urm...does the fact that it doesnt validate their password b4 accepting their credit details count as a logic error or a design flaw.
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
Logic error = works fine but the expected output is wrong?
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
Originally posted by True_Monolith07
urm...does the fact that it doesnt validate their password b4 accepting their credit details count as a logic error or a design flaw.
The card details are, in terms of the system given, just the CustomerNumber. I'd say the StoredPassword is looked up in the banks database using the CustomerNumber. The pass word is not validated until the ValidatePassword routine.
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
Originally posted by Ragerunner
Hmmm....interesting. Most I didn't pick up.

But did they expect us students to be able to do that?

Pretty bad question. And it was worth 4 marks!
No, you don't need all my waffle. That was my analysis of the question, not a recommended solution.

From a student's point of view it really doesn't matter too much that the question was a bit bodgy. The marking process is extremely thorough, and I can confidently say that answers with worth will be awarded marks accordingly.

HTH
Sam
 

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

Top