sdds (1 Viewer)

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
Yes you're correct.

However, remember that EOF() is actually a function included with most high-level languages. For example in VB it examines the current position of the pointer to the file indicated by the file number parameter to see if its end has been reached and then returns true or false accordingly. I mention this because you can't strictly expect this function to exist when writing algorithms.

In the exam it would be better to write WHILE Not end of file... rather than EOF or use some other technique, such as a sentinel. Obviously it largely depends on the question.
 

del

Member
Joined
Jul 8, 2002
Messages
412
Gender
Undisclosed
HSC
N/A
Ahh... cools

thanks heaps...
 

Winsux

Member
Joined
Jul 12, 2002
Messages
37
QUESTION!!!!

yeah, i know, its a bit too late, but has anyone done the very last question in the hardware option for last year's exam? i just can't get the circuit right??? PLEASE let there not be one of those questions tomorrow!
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
There are 3 inputs, lets call them A, B and C, where A is the fault detector, B the door and C the light switch.

For the light to burn A must be false (0) and B must be True (1) and C must be True (1). Any other combination results in the light not burning (0).

Now A is the reverse of the others so just add an inverter (NOT gate) immediately after this input. Now feed all three inputs into an AND gate (yes you can have three input AND gates).

Or feed two of them, say the inverted A and the B, into a two input AND gate, then feed the output from this gate and the input from C into a second AND gate.

Hope this makes sense...
 

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

Top