there were so many thigns wrong with that algorithm
all year they've been telling us "use intrinsic documentation" "comment your code" "make your code elegant"
that algorithm goes against everything they've ever tried to hammer into us
for part a i put that if the message header is anythign else, eg if there was an error in transmission or anything, the whole system would shut down. I think i stuffed the second part up because I thought systemstatis was passed on from one of the terminals cos it says inthe text that at the end of the day, the supervisor shuts down the system by entering system status = off
the deskcheck: hey a deskcheck won't help solve such a crappy algorithm. I put down that eventticketsavailable could be negaitve, and that a ticket is issued even if if there are no seats.
i didn't finsih part b
and why did they read system datae and systemtime twice?
i may be completely wrong, but since no one mentioned it, could the 2nd error in the desk check be on line 30 "EventTicketsAvailable = EventTicketsAvailable - NumberTicketsSold" but NumberTicketsSold is a field in TICKET rather than EVENT so it can't be called? Can someone check this please? thx =)
Do you mean EventTicketsAvailable is from ProcessEvent so it should be private to ProcessEvent and can't be used in ProcessTicket?
I guess that can be true, cause the exam setters have used STORE and READ on LastEventNumber to use it across different subprograms. Either that or they've just done it to show that the variable should be saved after the program goes offline.
I think any error based on the variables in this algorithm is abit risky, cause if you take the algorithm seriously, where are all those variables the STORE commands are using coming from? Its like they're just plucked out of thin air. If that was taken seriously then this algorithm would have a real problem cause pretty much none of the variables in the program would work since none of them have any value assigned to them.
One guy in my class actually got deparate and put that done as an error.
nono, thats not what i mean. I think they got the variables from a file called EVENT. the OPEN EVENT on line 28 opens the file so they can call the variable EventTicketsAvailable but the NumberTicketsSold is actually a variable in the TICKETS file so they can't call it just by opening the EVENTS file.
There shouldn't be any need to read from the file to obtain NumberTicketsSold. All these variables should be passed from the terminals. If it reads the value from a file, then it would be reading the number of tickets that the last transaction processed.
Where is the file being updated to let the algorithm know how many tickets have just been sold? It should be the terminals telling the algorithm what NumberTicketsSold is so that they can be printed.
i didnt think the exam was too bad..... and this is coming from one who totally sucks at sofware, mainly because i didnt put the effort in to it ever.... i couldnt be bothered doing much of the algoritm bit, so i concentrated on where i could get more marks rather than waste a good half an hour for something that i would have had gotten wrong anyway.... but hey... no more software EVER for me...