MedVision ad

Need HELP on a HSC question (1 Viewer)

chanfky

Member
Joined
Jul 25, 2002
Messages
52
This question is from the 1996 HSC 3U computing paper:

Desk checking is likely to find all errors EXCEPT
a) logic errors
b) syntax errors
c) run-time errors
d) program specification errors

The answer is (c), run-time errors. But I chose (b) because you won't really notice spelling mistakes when you do a desk check.

Can anyone explain why? :confused:
 
Last edited:

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
By definition a runtime error occurs when your code executes...so they can't really be picked up in a desk check. For example, whether the result of a computation fits in a certain data type will depend on the programming language you are using, and this isn't really possible to determine in the algorithms when you do a desk check.

It can't really be syntax errors because a syntax error is code that the compiler doesn't understand, but when you are desk checking your algorithms you are not really writing actual code, just pseudocode/algorithm, so theres no room for incorrect spelling of code or anything.
 

chanfky

Member
Joined
Jul 25, 2002
Messages
52
So which is the correct answer?

But then divide by 0 is a run-time error and can be detected during a desk check. So wouldn't a desk check be ABLE to detect a run-time error?
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
Actually thinking about it more....

I think the question is a little vague about what you are actually desk checking, because:

- If you are desk checking an algorithm then B would be correct because you haven't written the code yet so it would be impossible to check for syntax errors.

- But if you are desk checking your actual code then you would be able to pick up syntax errors, provided you know your syntax. In that case you won't be able to pick up all runtime errors, like overflows (but you'll might find divide by zero errors).

And since C has a bit of uncertainty, relying on the idea that the programmer knows the syntax, I would go with C. But if I did it in an exam it would be one of those questions I doubt the first time and come back and check!
 

do0d

Member
Joined
Aug 2, 2002
Messages
54
butttt
why cant you pick up a runtime error
say your code gets stuff from the harddrive
if the file doesnt exist u get an error
hence u can pick up run time errors

still runtime is prolly the most appropriate answer
 

Lazarus

Retired
Joined
Jul 6, 2002
Messages
5,965
Location
CBD
Gender
Male
HSC
2001
Can you tell whether the file on the hard drive exists just by looking at the algorithm? No.

There's also a lot more to syntax than spelling - it also involves using commands with the correct parameters in the correct order. Not too difficult to pick up via desk checking.

A run-time error is defined as being an error that occurs during the execution of a program. They indicate bugs in the program or problems that the designers had anticipated and could do nothing about. Run-time errors include trying to divide by zero, accesing non-existent files and running out of memory.

(c) is the correct answer.
 

do0d

Member
Joined
Aug 2, 2002
Messages
54
ehhehe hence why u do more then check your spelling when u do your desk check
but usually thatll pick up logic errors
then again quite a few runtime errors r logic errors whichcan be detected and rectified but designers forget/dont haf time etc etc
but anywho
 

do0d

Member
Joined
Aug 2, 2002
Messages
54
come back to me when you learn how to do a desk check properly before you get too sarcastic
 

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

Top