Re: Add Method




"shiv" <rajeev0628@xxxxxxxxx> wrote in message
news:1158955827.535227.123710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi, i need help with this method please. if anyone can help, i will
apreciated. A method called getUnsignedValue. This method should
calculate and return the decimal number equivalent to the binary number
stored in the object. This method should simply return the integer
equivalent of the Binary number object. The calculation is performed
assuming that the binary number object is in standard binary notation,
and therefore does not have negative values. Note: this method should
NOT change the data stored inside the object!

It's not entirely clear what you're asking. All data in the computer are in
binary, so is your object simply an Integer or even an int? What do you
mean by decimal equivalent? Do you mean to convert the number to a string?
"Standard" binary notation (2's complement in my world) includes negative
numbers, so you are saying this binary number is already unsigned? And
Integers are already immutable.

My guess is that this is an exercise for a 1st-year computer science course
and it means to convert positive number (probably in an int) into a String
for display--a very common type of exercise.

You'll have to explain more about what you're trying to do.

Matt Humphrey matth@xxxxxxxxxxxxxx http://www.iviz.com/



.



Relevant Pages