- Homework 10a, due Monday November 17.
- Fix up your calculator to handle exceptions: Badly formatted numbers and cases where the stack is too empty for a specified operation. (Operations include the arithmetic operations as well as the "." operation.)
- Exercise before doing 10b: (don't hand in, just make sure you can do it.)
- Convert 19 (decimal) to binary.
- Convert 1001101 (binary) to decimal.
- What number (in decimal) do the following expressions compute?
- (1<<5)
- (5|9)
- (5&4)
- (true & true)
- (true & false)
- (true | false)
- (1<<5)|(1<<3)
- Homework 10b, due Wednesday November 19.
- Modify the bitset.java class (shown in class on Nov 12) to have an "or" method.
public void or (bitset s) {
// effect: Modify this to contain all the bits in s as well as the bits already in this.
..
Turn in your bitset.java and bitset.class
- Homework 10c, due Friday November 21.
- Modify the bitset.java to have an "sameset" method.
public boolean sameset (bitset s) {
// effect: Returns true if the exact same set of bits is in this and s.
...
}
Turn in your bitset.java and bitset.class