CSC 148S

Spring 1998

Introduction to Computer Science

Assignment Messages

Assignment 0

There has been a question regarding the base of the numbers involved in the subtract method. You can assume that the numbers involved in the subtract method have the same base. Where the subtract method is used in the starter code the numbers being subtracted always have the same base.

Assignment 0

WARNING: The handout clearly says that you must use our algorithm and our code to convert from one base to the other. We will be checking programs and students who have not followed these directions will receive a zero for the assignment.

Assignment 0

A student made an observation regarding the copyTo method in the NIB class. After execution of copyTo, my number of digits will either stay the same or be smaller than my number of digits before execution. This is correct. copyTo is used to copy digits to me when I am shrinking. (Specifically copyTo is used in the divide and remainder methods as the part of the dividend that is meaningful shrinks.)
By contrast, my putDigit method is used when my number of digits maybe growing.

Some students have reported confusion when converting from one base to a larger base. Eg.

315 base 8 => base 16
The first step is to divide 315 base 8 by 16, but you have to think of the 16 as 20 base 8 so that the whole division is in base 8.
Also check the example that was provided along with the assignment description.

Assignment 0

There is a flaw in the starter code for Assignment 0. The class NIB has

static int MAX_DIGITS = 20;
It was intended and the capitalization implies that this is a constant, but it's missing the keyword "final" that will make it so. The keyword "static" means something different.
There is no need to change your code, just be aware of this flaw.

There may be other flaws or inefficiencies in the code that is provided. Make a note of them. There is no need to correct them.

Assignment 0

Students, who are compiling the java files using a newer version of java, will get a warning that requests they use the -deprecation flag when compiling. Recompile as follows:

javac -deprecation FILENAME.java
If you do not get this warning, disregard this advice.

Assignment 0

The input is not exactly as described in the assignment hand out. The assignment says the input is three integer values. In fact the input is three values:

The base of the number being converted. (an integer)
The base of the result. (an integer)
The number to be converted. (This value is read as a string so should be enclosed in quotes.)
The input for the example described in the assignment would be:
8
2
"315"

Assignment 0

The general example of a positive integer: tex2html_wrap121
has n+1 digits not n as stated in the assignment.

Places to go: