Java Forum / General / September 2006
Java Question
Justin - 19 Sep 2006 06:44 GMT Which of the following would be the best choice to make a class constant of the class Tortoise?
A. Weight B. Number of Legs C. Age D. Average Age E. Longest Recorded Age
Thank you.
IchBin - 19 Sep 2006 07:09 GMT > Which of the following would be the best choice to make a class > constant of the class Tortoise? [quoted text clipped - 6 lines] > > Thank you. Hard to answer being taken out of context.
ans. E
 Signature Thanks in Advance... IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us __________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"' -William E. Taylor, Regular Guy (1952-)
Gordon Beaton - 19 Sep 2006 07:11 GMT >> Which of the following would be the best choice to make a class >> constant of the class Tortoise? [quoted text clipped - 8 lines] >> > Hard to answer being taken out of context. Context: homework.
/gordon
 Signature [ don't email me support questions or followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e
IchBin - 19 Sep 2006 07:33 GMT >>> Which of the following would be the best choice to make a class >>> constant of the class Tortoise? [quoted text clipped - 12 lines] > > /gordon Yea.. keep on forgetting it's time of year.
 Signature Thanks in Advance... IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us __________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"' -William E. Taylor, Regular Guy (1952-)
Thomas Weidenfeller - 19 Sep 2006 11:06 GMT >>> Which of the following would be the best choice to make a class >>> constant of the class Tortoise? [quoted text clipped - 10 lines] > > Context: homework. And they are still so easy to identify: National University of Singapore this time. So we can point the OP to http://www.comp.nus.edu.sg/students/plagiarism/
/Thomas
 Signature The comp.lang.java.gui FAQ: ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Chris Uppal - 19 Sep 2006 12:03 GMT > And they are still so easy to identify: National University of Singapore > this time. So we can point the OP to > http://www.comp.nus.edu.sg/students/plagiarism/ Altough, when the university's official "Plagiarism Warning Notice" (first link on that page) is not only a .DOC file (which only a fool would download), but is also accessed via an SSL link (a good think in itself) with an expired certificate, the impression is not given that the university gives a rat's arse one way or the other. (I bet it does though).
The PDF version of the "Plagiarism Warning Notice" (further down the page, under Teaching Resources) is a broken link. As is "Penalties for Plagiarism"...
Notice also that the page doesn't bother to tell students /why/ they should follow any of the links.
Pathetic.
-- chris
Justin - 19 Sep 2006 14:35 GMT What does it have to do with Comp.nus.edu.sg??
> >>> Which of the following would be the best choice to make a class > >>> constant of the class Tortoise? [quoted text clipped - 20 lines] > ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq > http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/ Thomas Weidenfeller - 19 Sep 2006 16:29 GMT > What does it have to do with Comp.nus.edu.sg?? >> And they are still so easy to identify: National University of Singapore >> this time. So we can point the OP to >> http://www.comp.nus.edu.sg/students/plagiarism/ >> >> /Thomas Ah, that was another on asking for homework help today. Message-ID: <1158632912.281485.310340@m73g2000cwd.googlegroups.com>
I shouldn't edit multiple postings a the same time.
 Signature The comp.lang.java.gui FAQ: ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Rogan Dawes - 19 Sep 2006 16:59 GMT >> What does it have to do with Comp.nus.edu.sg?? >>> And they are still so easy to identify: National University of Singapore [quoted text clipped - 7 lines] > > I shouldn't edit multiple postings a the same time. Actually, I think you were correct on this one, too.
From the headers of the OP's post:
Injection-Info: m73g2000cwd.googlegroups.com; posting-host=137.132.3.11; posting-account=3kQIVw0AAABie91wMVko4ta26C2TXLPQ
$ whois 137.132.3.11 [snip] person: Computer Centre National Universityof Singapore address: 2 Engineering Drive 4, National University of Singapore117584 country: SG phone: +65 8742484 e-mail: ccenet@nus.edu.sg nic-hdl: CCNU1-AP remarks: ---------- remarks: imported from ARIN object: remarks: remarks: poc-handle: DA18-ORG-ARIN remarks: is-role: Y remarks: last-name: Computer Centre, National Universityof Singapore remarks: street: 2 Engineering Drive 4, National University of Singapore117584 remarks: country: SG remarks: mailbox: ccenet@nus.edu.sg remarks: bus-phone: +65 8742484 remarks: reg-date: 1999-03-09 remarks: changed: hostmaster@arin.poc 20020215 remarks: source: ARIN remarks: remarks: ---------- notify: ccenet@nus.edu.sg mnt-by: MNT-NUS-SG changed: hostmaster@arin.poc 20020215 changed: hm-changed@apnic.net 20040123 source: APNIC
M.J. Dance - 19 Sep 2006 14:43 GMT >>>> Which of the following would be the best choice to make a class >>>> constant of the class Tortoise? [quoted text clipped - 14 lines] > this time. So we can point the OP to > http://www.comp.nus.edu.sg/students/plagiarism/ It's not plagiarism if one cites the source. Be that Usenet or not.
Actually, assembling partial third party solutions into another, complex one, can be regarded as good engineering. You don't have to reinvent the wheel. Maybe just suspension. :-)
Justin - 19 Sep 2006 14:34 GMT Context: homework <== wrong
Students arguing on it! So, want to take "different" ppl's opinion
That's it
> >> Which of the following would be the best choice to make a class > >> constant of the class Tortoise? [quoted text clipped - 16 lines] > [ don't email me support questions or followups ] > g o r d o n + n e w s @ b a l d e r 1 3 . s e Chris Uppal - 19 Sep 2006 14:47 GMT > Context: homework <== wrong > > Students arguing on it! So, want to take "different" ppl's opinion That's fine (if somewhat unusual), but you could have ensured that you were understood from the start if you had (a) mentioned it, (b) posted your own opinion and the reasons behind it, and (c) posted the other student(s)' onion(s) and their reasons. That would also have stopped your question looking as if you'd just copy-and-pasted it from your coursework (which is normally a dead giveaway that someone is trying to cheat).
FWIW my own opinion is that none of them are suitable for making into constants -- for the simple reason that none of them are, in fact, constant.
Now it's your turn...
-- chris
Oliver Wong - 19 Sep 2006 22:17 GMT > FWIW my own opinion is that none of them are suitable for making into > constants -- for the simple reason that none of them are, in fact, > constant. That's not one of the choices offered, though. Make the age constant: What's the chance that a trivial Java program for a first year computer science assignment would run for more than one consecutive year?
- Oliver
Daniel Dyer - 19 Sep 2006 22:33 GMT >> FWIW my own opinion is that none of them are suitable for making into >> constants -- for the simple reason that none of them are, in fact, [quoted text clipped - 3 lines] > constant: What's the chance that a trivial Java program for a first year > computer science assignment would run for more than one consecutive year? It's talking about static fields. There is only one field in that list that could feasibly have the same value for all tortoise instances and not change over time.
Dan.
 Signature Daniel Dyer http://watchmaker.dev.java.net - Evolutionary Algorithms for Java
Oliver Wong - 19 Sep 2006 22:47 GMT >>> FWIW my own opinion is that none of them are suitable for making into >>> constants -- for the simple reason that none of them are, in fact, [quoted text clipped - 5 lines] > > It's talking about static fields. Oops. I missed the part about it being static. Well, my answer still holds if there's only 1 turtle in the simulation. Or if all the turtles are the same age. Or if each turtle instance additionally stores a mutable "ageOffset" which is added to the class age to determine each instances particular age. The advantage of this last design is that we'd only need to increment to single static age field to get all the turtles to age simultaneously, rather than iterating through each turtle and aging them individually (which may perhaps result in race conditions?)
(I'm joking, of course)
> There is only one field in that list that could feasibly have the same > value for all tortoise instances and not change over time. I don't know, in my opinion all those values might vary over time. If I increase my suspension-of-disbelief threshold a bit, there are 3 fields which conceivably would not vary over time (depending on how simplistic we make our turtle-simulator app), and they're all sort of tied IMHO in terms of plausibility.
- Oliver
Chris Uppal - 20 Sep 2006 09:20 GMT > If > I increase my suspension-of-disbelief threshold a bit, there are 3 fields > which conceivably would not vary over time (depending on how simplistic we > make our turtle-simulator app), and they're all sort of tied IMHO in terms > of plausibility. Agreed. A three-way tie it is (without further knowledge of the problem the program is intended to solve).
-- chris
Justin - 20 Sep 2006 15:01 GMT Yes...I have argued that none of them can be declard a class constant...
Didn't think that ppl will be messing around in this thread...
What i want to say is "this is an MCQ and what max score can it offer? at most 1 point and there's no point for me, even if I need, to ask for help here just for 1 point...I posted it coz i wanted to see how different ppl will answer this Q...
> > Context: homework <== wrong > > [quoted text clipped - 13 lines] > > -- chris Oliver Wong - 20 Sep 2006 15:51 GMT > Yes...I have argued that none of them can be declard a class > constant... [quoted text clipped - 5 lines] > help here just for 1 point...I posted it coz i wanted to see how > different ppl will answer this Q... Well, nobody knew it was worth only 1 point. (We still don't know, you could be lying, for example). We also don't know 1 point out of what. If the assignment totals 3 points, than 1 point is a significant fraction of that. We also don't know if you're a borderline student, and only need 1 more point to pass the course, in which case this 1 point would be extremely valuable to you.
Being able to provide sufficient information and model the reasoning of people who may not have as much information as you have about a situation are important skills to develop. You'll need it if you want to develop good compression algorithms or networking protocol (i.e. what information does the server need to explicitly send the client, and what information can the client derive), or even just for writing a design document or for adding documentation to your source code.
- Oliver
Daniel Dyer - 20 Sep 2006 22:29 GMT > Yes...I have argued that none of them can be declard a class > constant... Unless you are considering the possibility of unfortunate accidents, I think it is safe to say that number of legs could be a class constant - i.e., every tortoise has four legs. Age and weight differ between separate tortoises and while average weight and longest recorded age apply to tortoises at the class level, rather than to individual tortoises, they will not be constant over time.
Dan.
 Signature Daniel Dyer http://www.dandyer.co.uk
Oliver Wong - 20 Sep 2006 22:53 GMT >> Yes...I have argued that none of them can be declard a class >> constant... [quoted text clipped - 5 lines] > to tortoises at the class level, rather than to individual tortoises, they > will not be constant over time. The number of legs is one of the three way ties I was thinking of. Average weight and longest recorded age are the others. Average weight might not be the average weight of only the turtles in the simulator, but of all turtles, past present and future. I.e. it might be derived from some model that biologists have about turtles. E.g. the average weight of a hawksbill hatchling is said to be 13.5 to 19.5 grams. It doesn't matter how many turtles are in your simulator, nor what they weight; the average weight of a hawksbill hatchling would remain constant regardless.
Similarly for longest recorded age. If it is known that turtles of a given species have a life expectensie distributed normally around 200 years with a standard deviation of about 30 years, but one freak turtle was discovered to have lived two thousand years due to special circumstances (perhaps surviving in a special environment which no longer exists), we could probably safely rule out the possibility of ever seeing another turle live as long (at least with the same, if not greater, plausibility that we'd rule out the possibility of a turtle ever losing a leg), and just hardcode that 2000 years is the longest recorded age, regardless of what age the turtles in our simulator would ever reach. Perhaps the longest recorded age field might even be used as a sanity check, so that if the ages of any turtles in the simulator reaches that, we know some sort of error occurred somewhere.
- Oliver
Chris Brat - 19 Sep 2006 12:16 GMT You could say B but that depends on how unlucky your tortoise is.
> Which of the following would be the best choice to make a class > constant of the class Tortoise? [quoted text clipped - 6 lines] > > Thank you. Chris Uppal - 19 Sep 2006 12:51 GMT > You could say B but that depends on how unlucky your tortoise is. I remember a news story from a few years back where one such unlucky tortoise had been fitted out with castors.
It seemed to be happy enough, although it's always difficult to tell what a tortoise is /really/ thinking...
-- chris
Chris Brat - 19 Sep 2006 12:59 GMT He probably still wouldn't beat the hare though...
> > You could say B but that depends on how unlucky your tortoise is. > [quoted text clipped - 5 lines] > > -- chris 绝望的笨蛋 - 21 Sep 2006 04:11 GMT > Which of the following would be the best choice to make a class > constant of the class Tortoise? [quoted text clipped - 6 lines] > > Thank you. I think the B & E can be as constant in future 100 years
IchBin - 21 Sep 2006 05:11 GMT > Which of the following would be the best choice to make a class > constant of the class Tortoise? [quoted text clipped - 6 lines] > > Thank you. OK, the only thing that, in all probability, will not change and be considered a constant would be 'B'. All else can be average out..
 Signature Thanks in Advance... IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us __________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"' -William E. Taylor, Regular Guy (1952-)
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|