• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: How to answer this sample essay question?

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my study guide, there's an essay question:
A. Describe two approaches to indicate to a caller of a method that the method has failed its operation. One of this operations should be the one you implemented in your assignment submission.
B. Which did you use
C. Describe the advantages and disadvantages of each approach.
answer: 1. throw an exception 2 return a value

it said there would be one approach that i used, but in my assignment, i used both, the low level db file accessing used "throw an exception", but the middle level that receives those exceptions returned a value to the top level, and also provide a getMessage() that returns a message describes previous action, so the top level just need to receive the value and the message, then tells the user whether the action is successful or not according to the return value (true or false), and also display the returned message that describes the previous action, because I don't want the user see the exception message. So how to answer this question according to my work???
[ April 10, 2004: Message edited by: HaoZhe XU ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi HaoZhe,
You just answered it .
The exam is for one thing only: to prove that you wrote the assignment you submitted.
As such, your answer would be perfect: it shows that you know that your assignment uses both approaches. Someone who did not write the assignment would probably not know that both approaches were used.
It would be nice if you explained why you used one method in one part of the assignment and another method in another part of the assignment.
Regards, Andrew
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your response, but I'm still a little bit confused: there's a sentence "one of them should be in your assignment."
so the "one" and "should" scared me, it seems like I missed a "must".
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi HaoZhe,
I'm still a little bit confused: there's a sentence "one of them should be in your assignment."
so the "one" and "should" scared me, it seems like I missed a "must".

I think that the "one" can be translated by "at least one", so you're OK.
Regards,
Phil.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic