QUESTiONS!
Should a static class method should be accessed by dereferencing an object of the class? (yes/no)
A static class method might take one or more objects of its class as parameters -- or it might take none -- depending on the purpose of the method. (true/false)
When an object is passed as a (normal) parameter to a method, modifying the members of that object from inside the method will result in a change to that object as seen from the client, after the method call is complete. (true/false)
When an array is passed as a (normal) parameter to a method, modifying the elements of the array from inside the method will result in a change to those array elements as seen from the client, after the method call is complete. (true/false)
Searching an array using a binary search ...
A. ... takes longer (usually) for each search than a simple linear search.
B. ... requires a pre-sorted array in order to work.
C. ... is usually faster for each search than a simple linear search.
D. ... requires more code and logic than a simple linear search.
(choose one or more)
Which are true about instance variables of a class (check all that apply): A. They should usually be declared private.
B. Mutators should protect them by filtering bad parameter values before assigning those values to them.
C. Loop counters and other helper variables should be declared as instance variables so that such counters and helpers don't have to be re-declared local to every member method, individually.
D. Member instance methods of the same class must use mutator methods to modify their values.
(choose one or more)
[1700 byte] By [
xtine556a] at [2007-11-26 12:23:03]

Yes. Those are all questions.
Why don't you tell us what you think, and why, and somebody will comment on it.
> Should a static class method should be accessed by
> dereferencing an object of the class? (yes/no)
>
> A static class method might take one or more objects
> of its class as parameters -- or it might take none
> -- depending on the purpose of the method.
> (true/false)
>
> When an object is passed as a (normal) parameter to a
> method, modifying the members of that object from
> inside the method will result in a change to that
> object as seen from the client, after the method call
> is complete. (true/false)
>
> When an array is passed as a (normal) parameter to a
> method, modifying the elements of the array from
> inside the method will result in a change to those
> array elements as seen from the client, after the
> method call is complete. (true/false)
>
> Searching an array using a binary search ...
> A. ... takes longer (usually) for each search than a
> simple linear search.
> B. ... requires a pre-sorted array in order to work.
>
> . ... is usually faster for each search than a simple
> linear search.
> D. ... requires more code and logic than a simple
> linear search.
> choose one or more) D, C
>
> Which are true about instance variables of a class
> (check all that apply): A. They should usually be
> declared private.
> B. Mutators should protect them by filtering bad
> parameter values before assigning those values to
> them.
> C. Loop counters and other helper variables should be
> declared as instance variables so that such counters
> and helpers don't have to be re-declared local to
> every member method, individually.
> D. Member instance methods of the same class must
> use mutator methods to modify their values.
> choose one or more) D,C
k.. that is what i think...
1)
Message was edited by:
xtine556
> Why don't you tell us what you think, and why, and
> somebody will comment on it.
Okay.
I think xtine556 is a lazy student. I think this because he just posted his homework verbatim and can't be bothered to even put any effort into his subject line. Also because xtine556 has previously shown an inclination to have others write his "codes" for him.
I eagerly await your comments.
> k.. that is what i think...> Because why again?
Please don't post your homework here.....
EKTa at 2007-7-7 15:22:30 >

I would say:Should a static class method should be accessed by dereferencing an object of the class? NoBinary search: B, CInstance variables: A, B
> k.. that is what i think...Sorry, but most of your answers are wrong. Look them up in the textbook.Kaj
> Should a static class method should be accessed by
> dereferencing an object of the class? (yes/no)
>
> A static class method might take one or more objects
> of its class as parameters -- or it might take none
> -- depending on the purpose of the method.
> (true/false)
>
> When an object is passed as a (normal) parameter to a
> method, modifying the members of that object from
> inside the method will result in a change to that
> object as seen from the client, after the method call
> is complete. (true/false)
>
> When an array is passed as a (normal) parameter to a
> method, modifying the elements of the array from
> inside the method will result in a change to those
> array elements as seen from the client, after the
> method call is complete. (true/false)
>
> Searching an array using a binary search ...
> A. ... takes longer (usually) for each search than a
> simple linear search.
> B. ... requires a pre-sorted array in order to work.
>
> . ... is usually faster for each search than a simple
> linear search.
> D. ... requires more code and logic than a simple
> linear search.
> choose one or more) B and C
>
> Which are true about instance variables of a class
> (check all that apply): A. They should usually be
> declared private.
> B. Mutators should protect them by filtering bad
> parameter values before assigning those values to
> them.
> C. Loop counters and other helper variables should be
> declared as instance variables so that such counters
> and helpers don't have to be re-declared local to
> every member method, individually.
> D. Member instance methods of the same class must
> use mutator methods to modify their values.
> choose one or more) A and B
Looks better, but it's harder to implement binary search than normal linear search. Can you also explain why you different answers on the questions on modification of attributes of an argument, and modification of an array?Kaj
This kind of people should be given a punch in the face, and take take their pants on the heads
> This kind of people should be given a punch in the> face, and take take their pants on the headsWhat are you talking about?
> What are you talking about?i am talking about what u were talking about... the people who don't like to crack the brains to get solution rather than just post it and wait for the answers..ssssssssmokeeeeeeeen
> This kind of people should be given a punch in the> face, and take take their pants on the headsInteresting choice of words, is this a 'local' saying translated to English?
> Interesting choice of words, is this a 'local' saying> translated to English?no!!! it just translated to Java