ICT 214 Tutorial Week 2
-
Using the number operators / and %, print an integer (with
value less than 512) as a string of three octal digits
-
Given a string of characters containing three octal digits,
convert it to an integer, using the String method
charAt()
, and converting a char to a number by
subtracting 60: n = ch - '0'
-
Use the
format
method of String to convert
an octal number (e.g. 020) to a decimal string
-
Use the method
Integer.parseInt(String s, int radix)
to convert a string containing an octal number to an integer
-
Complete the program to turn an IP dotted address into a 32-bit integer
-
Write a program to turn a 32-bit integer into a string containing
an IP dotted address
Jan Newmarch (http://jan.newmarch.name)
jan@newmarch.name
Last modified: Tue Feb 26 09:13:55 EST 2008
Copyright ©Jan Newmarch