Assignment 3, due Feb 5
Part of
the homework for CS:2820, Spring 2016
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of lecture on the day indicated (usually Friday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
a) In a&b, to what class (type) must a and b belong.
b) In a&&b, to what class (type) must a and b belong.
c) In a[i++]&b[i++] how many times is i incremented?
d) In a[i++]&&b[i++] how many times is i incremented?
e) What is similarity between the & and && operators that justifies using related symbols for them?
As in the previous assignment, legible handwritten code is sufficient, but you can be more assured that it works if you try it on a computer. (1 point)
a) Give Java code that captures all of the attributes of a neuron cell body. No methods are required, just the data attributes. (0.3 points)
b) Give Java code that captures all of the attributes of an axon. Again, no methods are required, just the data attributes. (0.3 points)
c) Give Java code that captures all of the attributes of a synapse. Again, no methods, just the data attributes. (0.3 points)
d) Comment briefly on the correctness of this statement: There would be no loss of generality if axons and synapses were folded together into a single class combining the attributes of both. (0.1 points)